I can use an update inside a loop to make a value grow.
I can find an update that is in the wrong place.
Before class
Run the spiral, then make the thickening spiral from the Make step. The key line is size = size + 5, which looks wrong to anyone used to maths: in Python it means "work out size + 5, then store it back in size". Be ready to say that out loud.
Running the lesson
Predict: show the spiral and ask whether it looks different from last lesson's. The wrong options include an error, because many students think size cannot equal size + 5. The counter spiral and the update spiral look the same: ask why before running.
Say it aloud: read size = size + 5 right to left. Work out size + 5, then store the answer back in size. Say 'store' instead of 'equals'.
Investigate: settle what is stored, trace the value over four passes, then show the update outside the loop and ask what happens. The last question links back to the counter: two ways to get the same lengths.
Modify: one number changes. Let students predict before they run.
Make: a second variable that updates itself. Students who finish can try changing the amount added to the thickness.
The hard part (on purpose)
Reading size = size + 5 as an equation. Have them trace the first three values on paper before running it.
When students get stuck
The spiral is a square, with every line the same length. Ask: Does anything change size while the loop runs? Fix: Add size = size + 5 as the last line inside the loop (indented).
One small square is drawn over and over. Ask: Is the update line indented under the for line? Fix: The update must be inside the loop to run on every pass.
A student thinks size = size + 5 is an error. Ask: Which side does Python work out first? Fix: Work out the right side, then store the answer in the name on the left.
Stretch and support
Stretch: Make the spiral shrink instead, by subtracting each pass. What happens when size goes below 0?
Support: Give the trace table with the first two rows filled in and ask the student to continue it.
Where it leads
Next, a street of houses reads a whole program that uses loops, names, the counter and updates together. Scores, timers and bank balances all update this way. Class ideas: a growing-colour spiral; a countdown.
What each step is for
Investigate: A variable can change itself: the right side is worked out first with the old value, and the answer is stored back.
Modify: Changing the amount added changes how fast the value grows, with one edit.