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) ഉൾപ്പെടില്ല!

Challenge

+25 XP

for loop ഉപയോഗിച്ച് 1 മുതൽ 10 വരെ 5-ന്റെ ഗുണനപ്പട്ടിക print ചെയ്യൂ. ഓരോ വരിയും ഇങ്ങനെ: 5 x 1 = 5

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