Skip to content
PlayOwl

Coding · Grade 9

Selection and Repetition

Built around a school weather station, the course develops selection (elif chains, nested conditions, branch order and boundaries) and Boolean logic (short-circuit evaluation and De Morgan's laws), then repetition patterns with for, while, break, continue, sentinels and nested loops. It closes with reasoning about loop correctness: termination, off-by-one errors and loop invariants.

  • 4 lessons
  • About 90 minutes
  • Check what you learned: 8 questions
  • Ways to answer: choose an answer, put code in order, trace code, match pairs, type a number and sort into groups
Try it now (no account) One of the five free starter courses Open in PlayOwl

What learners will discover

  • Trace and order if/elif/else chains and nested conditions, testing boundary values.
  • Evaluate and transform Boolean conditions using and, or, not, short-circuit evaluation and De Morgan's laws.
  • Trace for and while loops with break, continue, sentinels and nested loops.
  • Reason about loop correctness: termination, off-by-one errors and loop invariants.

Lessons

  1. Selection: choosing the right branch 6 steps3 practiceabout 20 min
  2. Boolean logic 6 steps4 practiceabout 22 min
  3. Repetition patterns 5 steps3 practiceabout 22 min
  4. Is the loop correct? 6 steps3 practiceabout 20 min
  5. Check what you learned 8 questions at the end

Keep exploring

More 9th grade coding

Guide for grown-ups