Lesson 14 of 34

break ಮತ್ತು continue

8 min 30 XP

break ಇಡೀ loop ಅನ್ನು ತಕ್ಷಣ ನಿಲ್ಲಿಸುತ್ತದೆ. continue ಈ round ನ ಉಳಿದ ಭಾಗ ಬಿಟ್ಟು ಮುಂದಿನದಕ್ಕೆ ಹೋಗುತ್ತದೆ.

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.