0
can someone explain to me why the result is 8 ?
x = 1 while (x <= 5): x += x print(x) 8
4 Answers
+ 3
Game0ver
x += x means x = 2 * x
So on x = 1, x = 2
On x = 2, x = 2 * 2 = 4
On x = 4, x = 2 * 4 = 8
Now 8 <= 5 false so x = 8
+ 2
Try to put x +=1
0
thank you so much