0
What does x += 1 this line do? I get same output even if I don't write this line
4 Answers
+ 3
Increments value by 1 . And i don't see why it should affect the output in anyway. Maybe you want to put it inside while loop with same indentation as if else block
+ 2
X+=1 means x=x+1
0
x = 1
while x < 10:
if x%2 == 0:
print(str(x) + "is even")
else:
print(str(x) + "is odd")
x += 1
#hope this helps you