0

Why it did not go to remaining while condition it run only the first while

https://code.sololearn.com/cS9s3Yimoi13/?ref=app

27th Sep 2018, 12:35 AM
Raj J
Raj J - avatar
2 Respuestas
+ 1
You don't need all these int(). x and y are integers anyway, they don't need to be converted to integers. continue interrupts the loop and jumps back to check the condition in line 4. m is 2 now, so the while loop is done. Nothing after line 8 will ever be executed
27th Sep 2018, 5:25 AM
Anna
Anna - avatar
0
x=12 y=3 m=1 while m <= 1: z=int(x)+int(y) m=m+1 print (z) continue while m <=1: z=int(x)-int(y) m=m+2 print (z) continue if you notice, in the first while you are adding 1 to "m" so its current value is 2. In that case the while loop finishes.
27th Sep 2018, 3:56 AM
Enzo Falcon
Enzo Falcon - avatar