0
Pls whatâs wrong with this?
e=3 while True: e=e+2 if e<4: print('yes') continue if e>4: print(e) print('finished')
7 Answers
+ 2
It's printing 'e' after adding 2 on it.
It will be executed repeatedly because the condition of while loop will always remain true.
And 'e' is assigned 3 here and after adding 2 only one time it will become 5 so, the first if statement won't run because 4 will never get the chance to be greater than 'e'...
In the next if statement 'e' will be always be greater than 4 because it became 5 after adding 2 only one time. So, it will keep printing 'e' after adding 2 on it.
0
Elijah Oduyemi
It's an infinite loop.what output do you want .
0
uday kiran to print e
0
value in e
0
Nothing wrong in your code.it is printing value in e for infinite times
0
okayy
thank you
0
okayyy
thank you ê§àŒRishabhàŒê§