Kids Coding

Repeat (Loops)

A for loop repeats work. Count. Print a pattern. Stop when you are done.

KidsBasicRepeat (Loops)

Do it more than once

A for loop repeats a block. range(5) means five times: 0, 1, 2, 3, 4.

Count

for n in range(5):
    print(n)

Print a word many times

Five hellos

for n in range(5):
    print("hello")

Count from 1

range(1, 6) starts at 1 and stops before 6. So you get 1, 2, 3, 4, 5.

1 to 5

for n in range(1, 6):
    print("Number", n)

The second number in range is the stop sign. Python does not include it.

Real life

Walking up the stairs and counting each step.

You do not write “step” twelve times. You repeat. A loop is the count.

Twelve stairs

for step in range(1, 13):
    print("Step", step)
print("At the top")

Change one word. Run it. That is how this idea shows up outside the lesson.

Try it

Exercise 1: Print Go! exactly three times using a loop.

Show solution
for n in range(3):
    print("Go!")

FAQ: Repeat (Loops)

Common questions about this page.

What is StudyGrid Kids?

StudyGrid Kids is a free coding path for children: Basic, Intermediate, and Advanced. Lessons use Python in the browser. No account and no install.

Should I run repeat (loops) examples locally for better learning?

Yes. Use the browser editor on StudyGrid for a quick check, then Download the example and run it on your computer. Local runs show real errors and the real toolchain, which is one of the fastest ways to learn repeat (loops) in this Kids Coding Python lesson (Repeat (Loops)).

Which kids level should we start with?

Start at Basic if the child has never written code. Choose Intermediate if they can print, use variables, and write a simple if. Choose Advanced if they already use loops and lists.

Do kids need an account or an app?

No. Kids pages are public. Code runs in the Try Python editor at /try. We do not ask children for a name or an email.

What language do kids learn?

Python, with a first HTML page in Intermediate and Advanced. After Advanced, the main Python tutorial is the next step.

Is the kids coding track free?

Yes. The Kids home, the three levels, and the Python editor on StudyGrid (studygrid.in) are free.