Python Loops: Trace the Output

A full lesson that teaches first: how for and while loops run, what range produces and how to keep a trace table, with worked traces and guided problems. Then students predict the exact output of four short Python programs and finish with a quick check.

First page of the worksheet “Python Loops: Trace the Output”
Download PDF

For members. Join for $119.88 a year to download every Grade 9 worksheet.

Grade
Grade 9
Subject
Technology
Skill
Trace for and while loops in Python to predict program output
Time
About 60 minutes
Includes
15 questions, answer key, teaching notes

Standards

  • CSTA 3A-AP-15

    Justify the selection of specific control structures, weighing readability and performance, and explain the benefits and drawbacks of the choices made.