Updated November 21, 2026 · 9-minute read
What: A loop tells a computer to repeat steps, so you write them once.
Who: Parents of 6–9-year-olds, and kids who love to create.
Why: Loops make code shorter and build pattern-spotting skills.
When: Try the 15-minute activity this weekend.
How: Play a screen-free robot dance, then repeat it in Scratch.
Your 7-year-old writes the same step again and again, then gets bored. You search for what is a loop in coding, and every answer sounds like a textbook. Without a simple picture, loops stay confusing, and curiosity fades fast.
This guide explains loops in plain words and gives you a 15-minute robot dance game. Your child learns by moving, then sees the same idea in a first coding lesson on screen. Let’s build it together.

A loop tells the computer to repeat a set of steps. You write the instruction once, then say how many times to run it.
Think of a loop as a ‘do it again’ button.
Your child already lives inside loops every day:
Coders call each repeat an iteration. Your 7-year-old doesn’t need that word yet. Loops sit beside sequences and choices in the ABCs of coding, and they’re often the first big ‘aha’ moment.
Loops give your child fast, visible wins. A short loop replaces a long, boring list of steps.
Here’s what your child builds when they learn loops:
Loops also hide inside every game your child plays. A character walks, a coin spins, and a timer counts down. Each one repeats steps.
Curious what else a beginner can do early on? Our guide to the best coding classes for 7-year-olds shows how first lessons build up. You can also read the benefits and tips of Scratch coding for kids.

Most beginners meet three loops. Each one answers a different question.
| Loop type | Kid-friendly meaning | Scratch block | Python version |
|---|---|---|---|
| Repeat (counted) | Do this a set number of times | repeat 10 | for i in range(10): |
| Forever | Keep going until the program stops | forever | while True: |
| Repeat until | Keep going until something happens | repeat until | while (condition): |
| Nested loop | A loop inside a loop (for later) | repeat inside repeat | for inside for |
Scratch keeps all of these in its Control category. See every category in our guide to the types of blocks in Scratch.
Wondering when to move from blocks to typed code? Read block-based vs text-based coding for kids.

You don’t need a screen, a robot, or any coding experience. This activity takes about 15 minutes.
Draw each card with a big icon. A clapping hand, a foot, a spiral arrow, and a wavy line work well.
Follow these six steps. Each one teaches a single loop idea.
Step 1: Meet the robot. Tell your child they’re a robot. Robots only follow the cards, exactly as written. Why it works: it teaches that computers need precise instructions.
Step 2: Program the long way. Lay out Clap, Clap, Clap, Clap, Spin. Your robot performs the dance. Why it works: your child feels how much repeating the long version takes.
Step 3: Spot the pattern. Ask, ‘What do you notice?’ Let your child point to the repeated Clap. Why it works: they discover the loop idea themselves.
Step 4: Add the Repeat card. Replace the four Claps with one Repeat 4 card and one Clap card. Your robot performs the same dance. Why it works: the result stays the same, but the instructions shrink.
Step 5: Swap roles. Now your child programs you. When the dance goes wrong, ask, ‘What did the robot do?’ Why it works: finding mistakes is debugging, a core coding skill. Our debugging in Scratch guide shows the same idea on screen.
Step 6: Try repeat until. Play music. Say, ‘Repeat Stomp until the music stops.’ Why it works: your child meets a loop that depends on a condition.
A loop doesn’t change what the robot does. It changes how little you have to write.
Fast learners and older kids can take on harder challenges. Try these:
Counting claps leads naturally to variables. Your child can meet them next in what is a variable in Python. Ready for a bigger step? See our best coding classes for 8-year-olds guide.
Want a mentor to guide the next step? ItsMyBot classes adapt to your child’s pace, and you’ll get progress updates along the way. Book a free trial class · Talk to our team

The dance cards map straight onto code. Your child already understands the idea. Now they see it on screen.
| Robot dance card | Scratch | Python |
|---|---|---|
| Repeat 4 | repeat 4 | for step in range(4): |
| Clap | move 10 steps | print(‘Clap!’) |
| Spin | turn 15 degrees | print(‘Spin!’) |
| Repeat until the music stops | repeat until (condition) | while music_playing: |
Here’s a Scratch loop your child can build in minutes:
when green flag clicked
repeat 4
move 10 steps
turn 15 degrees
end
And here’s the Python version, for when typing feels comfortable:
for step in range(4):
print('Clap!')
Scratch comes from MIT and runs free in a browser. Need help with setup? Follow our guide to downloading Scratch 3. For quick screen practice, try the Hour of Code activities or our list of Hour of Code games.
Picture Lily, age 7, and her toy Robo-Buddy. Lily lines up four ‘wave’ cards, then swaps them for one ‘Repeat 4’ card. Robo-Buddy waves four times either way. Lily grins and asks, ‘Can I make it wave forever?’ That question is the start of a forever loop.
These five slip-ups slow kids down. Each has a simple fix.
If your child loses interest, read why kids want to quit coding after two weeks.
Loops open the door to games, robots, and apps. Here’s a clear path through ItsMyBot courses, matched to what your child just learned.
| Next step | Why it fits | Course |
|---|---|---|
| Scratch games and animations | Practice repeat and forever blocks in real projects | Scratch Programming Course for Kids |
| A gentle start for the youngest learners | Build confidence with playful first lessons | Little Coder program |
| A full beginner-to-builder pathway | Grow from blocks to bigger projects | Junior Coder program |
| Typed code | Use for loops and while loops in Python | Python Course for Kids |
| Robots that move | Loops control motors and sensors | Best Robotics Classes for Kids and Cruiser Robotics for Kids |
| Apps people use | Repeat actions inside real apps | Mobile App Development Course for Kids |
| Smart projects | Loops power repeated steps in AI projects | AI and Machine Learning Course for Kids |
| Age-matched classes | Find the right level and pace | Coding classes for 7-year-olds and 8-year-olds |
Want to see everything? Browse all ItsMyBot courses or the online programs for kids. Not sure which fits? Read how to choose the right coding course for your child. You can also compare live 1-on-1 vs group coding classes and learn what to check in a free coding trial.
Keep the momentum going with these ItsMyBot guides:
A loop in coding repeats steps so you write them once. Your child now has a clear picture: dance cards, repeat blocks, and a first line of Python.
Teach loops early, and your child avoids copying the same code again and again. Skip them, and bigger projects feel slow and messy.
Ready to turn screen time into skill time? Try the Scratch Programming Course for Kids, or book a free trial class with an ItsMyBot mentor.
A loop is a coding instruction that repeats steps. Your child writes the steps once and tells the computer how many times to run them. Loops keep code short and games lively. A character that walks, a coin that spins, and a countdown timer all use loops.
Use a body-based example first. Ask your child to clap four times, then show a card that says Repeat 4: Clap. The action stays the same, but the instructions shrink. Our robot dance activity takes about 15 minutes.
A repeat loop runs a set number of times, such as repeat 10. A forever loop keeps running until the program stops, like a game character that keeps walking. A repeat until loop sits between them. It runs until something happens, such as touching the edge.
Yes. Screen-free play builds the same thinking. Dance cards, treasure hunts, and board-game paths all teach repeat patterns. Many kids grasp the screen version faster after moving through it first. A Scratch course then turns that idea into games and animations.
Scratch is the friendlier start. Its repeat and forever blocks snap together, so your child sees the idea without typing errors. Python comes next, once your child reads and types comfortably. Our block-based vs text-based guide explains when to switch.
Many children grasp a simple repeat loop in one short session. Forever and repeat until loops usually need a few weeks of playful practice. Pace varies from child to child. Short, fun sessions beat long ones, and a mentor can adjust the pace to your child.
Move on when your child builds Scratch projects alone and asks for more control. Reading comfort and typing skill matter too. Our Python Course for Kids picks up where Scratch leaves off.
Turn screen time into skill time.
Find the right class for your child today. Contact ItsMyBot

Online coding, AI, and robotics classes that help kids ages 5–16 build real skills — and confidence — one project at a time.
No commitment · Live class with an expert teacher
© ItsMyBot 2026. All Rights Reserved.