Prediction, Iteration, and Debugging in a Browser Python Lab
This exercise focuses on the programming cycle rather than software installation.
Goal
Practice prediction, execution, modification, and explanation with a short Python program.
Activity
- Open Code.org Python Lab.
- Run a short starter program containing a variable, a loop, and visible output.
- Before running it a second time, predict what will happen if one variable or loop bound changes.
- Make the change and run the program.
- If the prediction was wrong, identify which assumption was wrong.
- Make one additional change that deliberately causes unexpected output, then fix it.
Deliverable
Submit the original prediction, the changed code, the actual output, and a two- or three-sentence explanation of any difference.
Discussion
What did you learn from the wrong prediction that you would not have learned by only copying a working example?
Source material
First spotted in PTIR: August 1, 2026, Evening Briefing.
Code.org’s Python Lab was highlighted as a zero-install browser environment for real Python 3, including common data/science libraries and a visual Painter mode. The useful classroom implication was reduced setup friction: students can spend the exercise predicting, changing, running, and debugging code rather than installing a local toolchain first.