+ 6
Python - Why doesn't --a raise an error, but neither change "a" value?
a = 5 b = 7 if not a != b - 2: print("a =",a) print("b =",b) b = --a print("a =",a) print(a + b)
2 Answers
+ 4
It is just a double negation :
- - a = - 1 * -1 * a
So the only thing u r doing is setting b=a.
+ 4
I understand now! Thank you!