Python for Kids · Class 7 · Module 2 of 9

Logic and Validation

Real users type strange things. Good programs expect it.

8 sessionsSessions 9–16
4 weeksTypical pace
Foundation to IntermediateLevel
Class 7Python & Coding
A path splitting at a decision diamond into a tick and a cross
The big idea

This module is about programs that survive contact with actual humans. Nested conditions handle layered rules, logical operators combine questions, and validation politely refuses bad input instead of crashing.

Why it matters

Handling the unexpected is what separates a demo from a tool. It is also excellent logical training — the same reasoning used in maths proofs and legal-style rules.

Unpacked

What you will actually learn

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

01

Nested conditions

Nested conditions are questions inside questions: if the student is eligible, then check whether they are also on time. Drawing them as a flowchart first prevents most tangles.

02

Input validation

Validation means checking input before trusting it. Is it a number? Is it in range? Is it empty? Loop the question until the answer is usable.

03

Logical operators

and, or and not combine conditions. and needs everything true, or needs at least one, not flips the answer. Getting these wrong produces rules that quietly let the wrong people through.

Did you know?

The rule that “everything after or is checked only if needed” is called short-circuit evaluation — and programmers use it deliberately to avoid crashes.

Common mix-up

“if age > 12 and < 18” looks right but is not. Python needs the variable named twice: age > 12 and age < 18.

Session by session

Your 8-session journey

Sessions 916 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 nested conditions.

  2. 2

    Nested conditions

    Guided teaching on nested conditions, worked through together with the teacher.

  3. 3

    Nested conditions — practice lab

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

  4. 4

    Input validation

    Guided teaching on input validation, building directly on the previous two sessions.

  5. 5

    Input validation — practice lab

    Applied tasks that combine nested conditions and input validation in one piece of work.

  6. 6

    Logical operators

    Logical operators introduced and practised, completing the toolkit needed for the project.

  7. 7

    Project build

    Guided build session for the module project: Smart eligibility checker.

  8. 8

    Test, present and reflect

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

Project lab

Smart eligibility checker

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

Try this at home

Write a checker for a competition with three rules, then try to find an input combination that gets an ineligible entry accepted.

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

  • Explain and use nested conditions without prompting
  • Explain and use input validation without prompting
  • Explain and use logical operators without prompting
  • Build and finish smart eligibility checker
  • 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:

validation
Checking that input is usable before acting on it.
logical operator
and, or, not — used to combine conditions.
edge case
An unusual input right at the boundary of the rules.
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.