3.11) Shortcut Operations
There are a number of shortcut operations that you can use to add to or subtract to a number. For example:
Instead of writing:
>>> a = 3 >>> a = a + 1 You can write: >>> a+=1
Similarly you can write:
>>> a-=3 >>> a*=2
We will come back to these shortcuts when using loops.