Source Code:
(back to article)
# increment a variable by 1 x = 5 x += 1 print(x) # Output: 6 # decrement a variable by 1 y = 10 y -= 1 print(y) # Output: 9 # increment a variable by any value z = 20 z += 5 print(z) # Output: 25 # decrement a variable by any value w = 50 w -= 10 print(w) # Output: 40
Result:
Report an issue