Python Loops: Trace the Output

Students learn to trace a loop with a variable table, then predict the exact output of four short Python programs that use for loops, range, nested loops and a while loop.

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

For members. Join from $9.99 a month for unlimited downloads.

Grade
Grade 9
Subject
Technology
Skill
Trace for and while loops in Python to predict program output
Time
About 40 minutes
Includes
13 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.