Explain please how this programme works | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Explain please how this programme works

i=1 while i>=1: print(i) i=i+1 if i<=10: break

15th Dec 2019, 3:08 PM
⭕Programmer⭕
⭕Programmer⭕ - avatar
1 Answer
+ 3
since i =1 while i > = 1 is true # 1 = 1 so it will print i = 1 i = i +1 so i = 2 since i = 2 if i <= 10 is true # 2 < 10 so it breaks out of the loop only printing 1.
15th Dec 2019, 3:37 PM
Bahhaⵣ
Bahhaⵣ - avatar