Incrementing variable:


#1
x = x + 1

Above should increment x by 1, but is there a shortcut for this?


#2

yes and this is how it is written

x += 1 # to add 1 to the current  and store it in x

or

x  -= 1 # to subtract 1 from the current  and store it in x

or

x *= 1 # to multiply the current value of x by 1 ( I know silly)

or

x /=1 # to divide the current value of x by 1 (Yeah Yeah Yeah its silly)