Python for Kids · Class 7 · Module 8 of 9

Errors and Testing

Errors are not failure messages. They are the computer telling you exactly where it got confused.

8 sessionsSessions 57–64
4 weeksTypical pace
Foundation to IntermediateLevel
Class 7Python & Coding
A magnifying glass over code finding a bug, beside a passing test
The big idea

Students learn to read a traceback from the bottom up, handle predictable failures gracefully with try and except, and write test cases that check the awkward inputs rather than only the easy ones.

Why it matters

Debugging calmly is the single most transferable skill in the course. It is also the moment coding stops being frightening.

Unpacked

What you will actually learn

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

01

Tracebacks

A traceback names the file, the line and the type of error. Read the last line first — it is usually the actual answer.

02

Exception handling

Exception handling catches problems you can predict, such as text typed where a number belongs, and responds helpfully instead of crashing.

03

Test cases

Test cases are chosen deliberately: a normal value, a boundary value, an empty value and a plainly wrong value. Four tests catch most real bugs.

Did you know?

The word “bug” predates computers, but the most famous one was literal: a moth found inside the Harvard Mark II in 1947, taped into the logbook.

Common mix-up

“try/except fixes errors.” It only catches them. Wrapping everything in a bare except hides genuine bugs and makes them far harder to find.

Session by session

Your 8-session journey

Sessions 5764 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 tracebacks.

  2. 2

    Tracebacks

    Guided teaching on tracebacks, worked through together with the teacher.

  3. 3

    Tracebacks — practice lab

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

  4. 4

    Exception handling

    Guided teaching on exception handling, building directly on the previous two sessions.

  5. 5

    Exception handling — practice lab

    Applied tasks that combine tracebacks and exception handling in one piece of work.

  6. 6

    Test cases

    Test cases introduced and practised, completing the toolkit needed for the project.

  7. 7

    Project build

    Guided build session for the module project: Bug detective challenge.

  8. 8

    Test, present and reflect

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

Project lab

Bug detective challenge

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 64.

Try this at home

Take a working program, deliberately introduce three different bugs, swap with a partner, and time how long each takes to find.

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 8 can:

  • Explain and use tracebacks without prompting
  • Explain and use exception handling without prompting
  • Explain and use test cases without prompting
  • Build and finish bug detective challenge
  • 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:

traceback
The report Python prints when an error occurs.
exception
An error a program can catch and respond to.
boundary value
An input right at the edge of what is allowed.
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.