Lesson 12 of 34
for loop மற்றும் range()for Loops and range()
9 min 25 XP
ஒரே வரியை 100 முறை எழுத வேண்டாம்! for loop ஒரு வேலையை நாம் சொல்லும் எண்ணிக்கையில் திரும்பத் திரும்பச் செய்யும். range(5) என்பது 0, 1, 2, 3, 4.
Don't write the same line 100 times! A for loop repeats work as many times as you say. range(5) gives 0, 1, 2, 3, 4.
Example: edit me and press Run
Press Run to see the result here.range(start, stop, step): start-ல் தொடங்கி, stop-க்கு முன்பே நிற்கும். step என்பது ஒவ்வொரு முறையும் எவ்வளவு கூட்ட வேண்டும் என்பது.
range(start, stop, step) starts at start and stops before stop. step is how much to add each time.
Example: edit me and press Run
Press Run to see the result here.for loop ஒரு string-ன் ஒவ்வொரு எழுத்தின் மீதும் கூடச் செல்லும்.
A for loop can also go through each character of a string.
Example: edit me and press Run
Press Run to see the result here.range(1, 11) என்பது 1 முதல் 10 வரை. கடைசி எண் (11) சேர்க்கப்படாது!
range(1, 11) means 1 to 10. The last number (11) is not included!