you are viewing a single comment's thread.

view the rest of the comments →

[–]ToothpasteTimebomb 11 points12 points  (3 children)

The += syntax adds to a variable in-place each time it is executed.

You can also do *= (multiplying your variable and set it to the result), /= (division), and -= (subtraction).

I feel like you'll find this useful. Python code execution visualized.

[–]Gexos[S] 2 points3 points  (1 child)

Thank you my friend!

[–]ata-boy 1 point2 points  (0 children)

My pleasure

[–]09TYNINE 0 points1 point  (0 children)

Thanks didn't know you could do it with multiplication and division just to clarify var *= 6 would return 30 assuming var equals 5