+ 1
Question
What is the output of the code? X=0 While x<5: X = x+2 print (x) The answer is 6 why?
5 Respostas
+ 4
The answer comes 6 because before exiting the loop it adds 2 in 4.
+ 4
There is an increment of 2.
So it will start from 0 and will be incremented to 2,4 & finally 6.
+ 4
Run this code so you might get an idea what I'm trying to say
https://code.sololearn.com/cUaf8cS8d0gd/?ref=app
0
why 4? can it be 3, 2, or 1?
0
i still dont get why x = 4 can I put 3? cause 3<5 is also ture so the answer can be 5?