0
x=2
if x+=1==3 then why x-=1==2 (why not 1?)
2 Answers
+ 2
x+=1 means x=x+1. //x=2+1=3
x-=1 means x=x-1 //x=3-1=2
== comparison operator..,
= is assignment operator..
+ 2
x = 2
x += 1 # add 1, x is now 3
x -= 1 # let x be itself minus 1 => 2
Makes sense?