Nested Loops: Coding lesson for kids

In “Nested Loops”, children learn about for i in range(2): for j in range(2): print(i, j); for i in range(2): for j in range(3): print("*").

for i in range(2): for j in range(2): print(i, j): The INNER loop runs completely for every single pass of the OUTER loop.

for i in range(2): for j in range(3): print("*"): Total prints = outer count × inner count: 2 outer passes, each running the inner loop 3 times, is 2 × 3 = 6 stars.

This lesson is part of Python in Coding at Pearls Valley Academy — Real code, beginner-friendly syntax.

Each lesson starts with a short narrated, animated explanation, then hands-on practice. A wrong answer gets a gentle hint, never a penalty, and children earn stars and pearls as they go.