Python for Kids · Class 6 · Module 4 of 9

Loops and Patterns

Why type a line one hundred times when you can teach the computer to type it for you?

8 sessionsSessions 25–32
4 weeksTypical pace
BeginnerLevel
Class 6Python & Coding
A circular repeat arrow around a repeating pattern
The big idea

A loop repeats a block of code without repeating the typing. Students meet the counted loop (do this ten times) and the conditional loop (keep going until something changes), and learn to spot which one a problem is asking for.

Why it matters

Loops are where students first feel real leverage — five lines of code producing a page of output. It is also where patience with debugging genuinely begins.

Unpacked

What you will actually learn

Three core ideas, each taught with worked examples and then practised until it feels obvious.

01

For loops

A for loop runs a fixed number of times, like a running track with a set number of laps. range() decides how many laps and where they start.

02

While loops

A while loop keeps going as long as a condition stays True — a game that runs until lives reach zero, or a question repeated until the answer is valid.

03

Debugging infinite loops

An infinite loop happens when the exit condition can never be reached. Reading your own loop out loud and asking “what makes this stop?” fixes it almost every time.

Did you know?

The first infinite loop in this class is a rite of passage. Ctrl + C is the escape hatch every programmer learns on the same day.

Common mix-up

“The loop is broken because it printed too much.” Usually the loop is fine and the print statement is simply sitting inside it when it belonged outside.

Session by session

Your 8-session journey

Sessions 2532 of the 72-session year, at two one-hour sessions per week.

  1. 1

    Warm-up and big picture

    Where this module fits, what you will build, and a hands-on starter that gets everyone curious about for loops.

  2. 2

    For loops

    Guided teaching on for loops, worked through together with the teacher.

  3. 3

    For loops — practice lab

    Independent practice, small challenges and one deliberate mistake to diagnose.

  4. 4

    While loops

    Guided teaching on while loops, building directly on the previous two sessions.

  5. 5

    While loops — practice lab

    Applied tasks that combine for loops and while loops in one piece of work.

  6. 6

    Debugging infinite loops

    Debugging infinite loops introduced and practised, completing the toolkit needed for the project.

  7. 7

    Project build

    Guided build session for the module project: Pattern and times-table generator.

  8. 8

    Test, present and reflect

    Finish, test against the checklist, present the work and explain the decisions behind it.

Project lab

Pattern and times-table generator

Every module ends with something the student built themselves and can demonstrate. This is the piece that goes into their portfolio and gets explained out loud at the end of session 32.

Try this at home

Use nested loops to print a multiplication grid from 1 to 10, lined up in neat columns. Getting the spacing right is a puzzle of its own.

It is finished when

  • It works from start to finish without breaking
  • You can explain every part of it in your own words
  • You tested it and improved at least one thing afterwards
  • Someone else used or understood it without your help

By the end of this module

Students finishing Module 4 can:

  • Explain and use for loops without prompting
  • Explain and use while loops without prompting
  • Explain and use debugging infinite loops without prompting
  • Build and finish pattern and times-table generator
  • Test your own work and correct what you find
  • Talk an adult through what you made and why

Word bank

The vocabulary introduced here, in plain language:

loop
Code that repeats.
iteration
One single pass through a loop.
infinite loop
A loop with no reachable stopping point.
Module challenge

Think you have got this?

0 XPLevel 1 · Curious Beginner

6 quick questions drawn from this module — vocabulary, the project you build, and a myth-or-fact round. Every wrong answer explains itself, so a mistake still teaches you something.

🎯 6 questions⚡ Up to 80 XP

Your child's free trial is one message away.

Tell us your child’s class and what they enjoy. We will suggest the closest program fit—no pressure and no upfront payment.