Stepping through code and watching variables
Run paused code one line at a time using step over, step into or step out, while the watch panel shows each variable change, to find where a value goes wrong.
Understanding Stepping through code and watching variables in VCE Software Development U3O1
What it does: A watch entry names a variable or expression and displays its live value as you step through the code. Continue lets you jump to the next breakpoint instead of stepping line by line, which is useful once you have checked a section. Step into moves the debugger into the called function so you can run its lines one at a time. The first line where a value differs from what you expected is the clue. The bug is on that line or just before it. Step over treats a function call as one single step and does not go inside the function.
Common mistakes: Stepping over this line makes the watch panel show discount as 200, not 2. A 10% discount needs price * 0.1, not price / 0.1. The watch panel lists a variable called total, not totl. Stepping onto this line raises a NameError. It should be print(n, total).
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 168–177) and word search (Modules 168–193).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
step throughFill in the Blanks
Spot the Error
Student with a class code? Join your class →