+ 1
What is the the difference between "+=" and "=+"....I got different results using them
2 Réponses
+ 3
+= gives a number to a variable:
x = 4
x += 5 # x is now 9
But when you use =+, it just sets the number to positive ( doesn't really do anything):
x = 4
x =+ 5 # x is 5
(it is the same as x = +5 -> x = 5)
When using negative numbets, it will still be negative, because - and + will still be -
x =+ -5 # x = -5
+ 1
Thank you soo much...really explained that well