Lesson 14 of 34

break మరియు continue

8 min 30 XP

break మొత్తం loop ను వెంటనే ఆపేస్తుంది. continue ఈ రౌండ్‌లో మిగిలినది వదిలేసి తర్వాతి రౌండ్‌కి వెళ్తుంది.

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

while True అంటే “break వచ్చే వరకు ఎప్పటికీ కొనసాగు”. యూజర్ “stop” అని టైప్ చేసే వరకు input చదవడానికి ఇది ఉపయోగపడుతుంది.

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Challenge

+30 XP

input() తో సంఖ్యలను ఒక్కొక్కటిగా చదవండి. 0 వస్తే ఆపండి (break). ఋణ సంఖ్యలను వదిలేయండి (continue), చివరగా ధన సంఖ్యల మొత్తాన్ని మాత్రమే print చేయండి.

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.