Lesson 12 of 34
for loop மற்றும் 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) சேர்க்கப்படாது!