How can i use while break and continue | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 1

How can i use while break and continue

How can i use while break and continue

23rd Jun 2021, 12:18 PM
Ranjana Sharma
2 ответов
+ 1
Do courses in these order : python beginner , next intermediate , next data structures. Revise all learnings in python core. All topics explained with examples there. Mention specific which you don't understand in those specific topics. An ex: I=0 while I<10 : if i%2==0: continue if I==5 : break print(I) I+=1 1st if skips current iteration if I is even , 2nd if breaks loop if I==5 is true in other cases prints I and output you get 1 3 only.., Without break, while loop runs from I=0 to I<10 becomes false.
23rd Jun 2021, 12:58 PM
Jayakrishna 🇮🇳
0
Break means totally exit the loop And continue means skip a specific iteration
23rd Jun 2021, 12:25 PM
Atul [Inactive]