I would value an advice on the while loop. When i am in the loop i=i+1 i=1 while i<=0 i can't make up why 1 appears on screen? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I would value an advice on the while loop. When i am in the loop i=i+1 i=1 while i<=0 i can't make up why 1 appears on screen?

while loop

19th Aug 2016, 3:11 PM
Τηλέμαχος Στικούδης
Τηλέμαχος Στικούδης - avatar
2 Answers
0
i dont under stand whatyou want you should write the code like this i = -1 while i <= 1: print i i += 1 output will be below -1 0
19th Aug 2016, 3:18 PM
june song
june song - avatar
0
to output 1 change your code in while i<=0 to i>=0.
19th Sep 2016, 4:26 PM
Wai Hlyan Htun
Wai Hlyan Htun - avatar