Lesson 12 of 34
for Loops మరియు range()
9 min 25 XP
ఒకే లైన్ను 100 సార్లు రాయకండి! for loop మీరు చెప్పినన్ని సార్లు పనిని పునరావృతం చేస్తుంది. range(5) ఇస్తుంది 0, 1, 2, 3, 4.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.range(start, stop, step) start నుండి మొదలై stop కి ముందు ఆగుతుంది. step అంటే ప్రతిసారి ఎంత కలపాలి.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.for loop ఒక string లోని ప్రతి అక్షరం మీద కూడా నడుస్తుంది.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.range(1, 11) అంటే 1 నుండి 10. చివరి సంఖ్య (11) చేరదు!