alphaPlan · Programming reasoning worksheet
Predict, run, debug, create
Reference lesson: Programming in a Data World > Getting started > Turtle graphics and variables
Use this beside the computer
Write before running. The paper records your thinking; the `.py` file is where you program. Keep the learner sheet separate from facilitator answers.
1. First run
Expected: the Turtle window draws one blue horizontal line 80 pixels long. Record the command you used and any setup problem you solved.
2. Prediction and trace
distance = 80
turn = 90
pen.forward(distance)
pen.left(turn)
pen.forward(distance // 2)Before running, sketch the path and complete the state table.
| After line | distance | turn | Position/direction |
|---|---|---|---|
| pen.forward(distance) | |||
| pen.left(turn) | |||
| pen.forward(distance // 2) |
Actual result and difference from prediction:
3. One controlled modification
Change only `distance = 80` to `distance = 120`. Predict what will change and what will stay the same, then run and record the result.
4. Debugging log
distnace = 80
pen.forward(distance)
NameError: name 'distance' is not defined| Observed symptom | |
|---|---|
| Failing line and error category | |
| My hypothesis | |
| One change I tested | |
| Result after rerun |
5. Personal creation canvas
Choose: flag-like symbol, letter/initial, or tiny skyline. Sketch the path, then name the variables and first three moves before typing.
Variables and first three commands
Cause and effect: what did I change after the first run, and what changed on screen?
https://codeforalbania.com/en/learn/programming-data-world/01-getting-started/turtle-and-variables
Found something unclear, outdated or improvable? Suggest an improvement