Conditionals · Program Tracing

Read — build a mental model L2 Comprehension Relations ~2 min

Which branch runs?

What is printed?

temperature = 18
if temperature < 16:
    print("cold")
elif temperature < 22:
    print("mild")
else:
    print("warm")

Choose one

Why this activity was chosen
  • Bloom level: L2 Comprehension: Predict output by simulating execution.
  • Block Model level: Relations (step 3 of 4): how parts of the program affect each other: variable updates, function calls, data flow and control flow.
  • Misconception targeted: shown after you answer, so it does not give the answer away.

Tracing builds an operational mental model: what is true after each statement. Distractors are drawn from documented novice misconceptions rather than random wrong answers.

AI’s role here: AI may ask the student to fill a trace table. It must not emit the final output on demand.