Could anyone explain me the output? i = 0 while 1==1: print(i) i = i +1 print("Finished") Output: 0 Finished 1 Fi | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Could anyone explain me the output? i = 0 while 1==1: print(i) i = i +1 print("Finished") Output: 0 Finished 1 Fi

#python

19th Jul 2020, 6:40 PM
Dheeraj Mittal🇮🇳
1 Answer
0
you can just add an if i == x: break to count for your desired number (which is x)
19th Jul 2020, 11:10 PM
Arda Atıcı
Arda Atıcı - avatar