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
0
0
x = 0
while x < 5:
print(x)
x += 1
Thank you!
0
0
4.1
10
>>> a = 10
>>> a += 5
>>> a
15
Thank you!
10
0
Are there any code examples left?
New code examples in category Python