aboutsummaryrefslogtreecommitdiff
path: root/challenge-323/eric-cheung/python/ch-1.py
blob: c5134cdcab70721bd1e5092ffeeebdb366b7a1b3 (plain)
1
2
3
4
5
6
7
8
## arrOperations = ["--x", "x++", "x++"]  ## Example 1
## arrOperations = ["x++", "++x", "x++"]  ## Example 2
arrOperations = ["x++", "++x", "--x", "x--"]  ## Example 3

arrOutput = [1 if "++" in strOperator else -1 for strOperator in arrOperations]

print (sum(arrOutput))