what is += doing in python code example
Example 1: what does += mean in Python
x = 0
while x < 5:
print(x)
x += 1 #the x += 1 expression is a shortend version for x = x + 1
Example 2: what is += python
>>> a = 10
>>> a += 5
>>> a
15
x = 0
while x < 5:
print(x)
x += 1 #the x += 1 expression is a shortend version for x = x + 1
>>> a = 10
>>> a += 5
>>> a
15