0Pricing
Coding for Kids · Lesson

A Loop Inside a Loop

Loops within loops.

Loops Are Awesome! 🔁

Hi superstar! 🌟 You already know a loop repeats things. Today we learn something SUPER cool: a loop inside another loop!

It's like a robot doing a little dance over and over, while a bigger robot makes it dance again and again! 🤖

for i in range(3):
    print('Outer loop! 🤖')

What Is Nesting? 🪺

When you put one loop inside another, we call it a nested loop. Just like a tiny bird's nest sitting inside a big tree! 🪺🌳

The inside loop finishes ALL its turns before the outside loop moves on.

for big in range(2):
    for small in range(2):
        print('hello!')

All lessons in this course

  1. A Loop Inside a Loop
  2. Drawing a Grid
  3. Star Triangles
  4. Multiplication Table
← Back to Coding for Kids