# 2011. Final Value of Variable After Performing Operations ###### tags: `Leetcode` `Medium` Link: https://leetcode.com/problems/final-value-of-variable-after-performing-operations/description/ ## Code ```python= class Solution: def finalValueAfterOperations(self, operations: List[str]) -> int: x = 0 for op in operations: if op[1]=='-': x-=1 else: x+=1 return x ```