Lesson 13 of 34

while Loops: True ಇರುವವರೆಗೆ ಪುನರಾವರ್ತನೆ

8 min 25 XP

ಎಷ್ಟು ಬಾರಿ ಪುನರಾವರ್ತಿಸಬೇಕು ಎಂದು ಮೊದಲೇ ತಿಳಿಯದಿದ್ದಾಗ while ಬಳಸಿ. Condition True ಇರುವವರೆಗೆ loop ಮುಂದುವರಿಯುತ್ತದೆ.

Example: edit me and press Run

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

count = count + 1 ಮರೆತರೆ loop ಎಂದಿಗೂ ಮುಗಿಯದು (infinite loop). ಹಾಗಾದರೆ Stop ಒತ್ತಿ.

ಉದಾಹರಣೆ: ₹1000 ಉಳಿತಾಯ ತಿಂಗಳಿಗೆ 10% ಬೆಳೆದರೆ ₹2000 ತಲುಪಲು ಎಷ್ಟು ತಿಂಗಳು?

Example: edit me and press Run

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

months += 1 ಎಂಬುದು months = months + 1 ರ ಸಂಕ್ಷಿಪ್ತ ರೂಪ.

Challenge

+25 XP

while loop ಬಳಸಿ 5 ರಿಂದ 1 ರವರೆಗೆ ಹಿಮ್ಮುಖ ಎಣಿಸಿ, ಪ್ರತಿ ಸಂಖ್ಯೆಯನ್ನು ಬೇರೆ ಸಾಲಿನಲ್ಲಿ print ಮಾಡಿ. ನಂತರ Go! print ಮಾಡಿ.

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