CurriculumPython for Loops and range() for KidsDoing something many times

Python for Loops and range() Explained for Kids

for and range() — one instruction, run again and again.

Lesson 1 of 5PROAges 10+
See what PRO unlocks →

Doing something many times

You've written the same print() three times before to make three lines. There's a much better way.

for i in range(3): repeats the indented lines below it — three times, automatically.

for i in range(3):
    print("Roar!")

Output

Roar!
Roar!
Roar!

Change the number, change the count. No copy-pasting needed.

for i in range(5):
    print("Flap!")

Output

Flap!
Flap!
Flap!
Flap!
Flap!

i is the loop's own counter — it changes every single time the loop runs.

for i in range(4):
    print(i)

Output

0
1
2
3

A loop isn't just 'repeat this text' — it's 'run this code, with a different i each time.'

Check your understanding

for i in range(3): print("Go!") — does i actually change anything here?

for i in range(3):
    print("Go!")
  • i changes each time, but this code never uses it, so the output looks the same
  • No — i only exists if you print it
  • This is exactly the same as writing print("Go!") three separate times, with no real difference

Why: i really does become 0, then 1, then 2 — but this code never uses i, so you can't tell from the output. The loop is still doing real work each pass, even when that work happens to look identical.

What you'll practice

Make the dragon roar exactly 3 times — one roar per line. Use a loop, not three separate prints.

Unlock this lesson with PRO →

More from this topic

Doing something many times is one lesson inside Python for Loops and range() for Kids — see the full lesson order and what the whole topic covers.

View the full topic →