0

The answer should be 4 of the question after break!

12th Sep 2016, 8:54 PM
Nikhil Saxena
Nikhil Saxena - avatar
2 ответов
+ 4
Reminder of the question: How many numbers does this code print? i = 5 while True: print(i) i = i - 1 if i <= 2: break The answer is indeed 3. The code will print the numbers 5, 4, 3. Right after printing 3, i is decremented to 2 and we enter the if case, resulting in a break.
12th Sep 2016, 9:30 PM
Zen
Zen - avatar
0
I think so too, the answer must be 3
13th Sep 2016, 11:19 AM
Hyunwoong Jang
Hyunwoong Jang - avatar