← VCE Software Development U3O1

Setting a breakpoint

A marker set on a line of code (click beside the line number) that pauses the program there in debug mode, so you can inspect variables and step through the code.

Understanding Setting a breakpoint in VCE Software Development U3O1

What it does: Choosing a line just before the problem lets the student check variable values at the point where things start to go wrong. A conditional breakpoint skips every loop pass until the condition (here i equals 50) is true, so the student does not have to step through the loop manually. A breakpoint is set by clicking beside the line number. It is a marker added by the editor, not code you write. Breakpoints only pause the program when you run it in debug mode. A normal run ignores them. The fix is to start the program with Debug (not Run) so execution pauses at the breakpoint.

Common mistakes: The list is missing its closing bracket ]. This is a syntax error, so the program never starts and never reaches the breakpoint. It should be scores = [72, 85, 90]. The if line is missing its colon. This is a syntax error, so the conditional breakpoint inside the if block can never be reached. It should be if qty > 2:.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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.

Learning
Duo
How do you set a breakpoint in most code editors?
Type the word breakpoint at the end of the lineClick in the margin beside the line number
Matches
Run the program normally, then expect it to pause at the breakpoint on line 5
↓
Breakpoints only pause the program when it is run in debug mode. A normal run ignores them, so the program never stops.
Applying
Meanings
Term
breakpoint
Meaning
A marker set on a line of code (click beside the line number) that pauses the program there in debug mode, so you can inspect variables and step through the code.
Practice
marks = [45, 60, 72, 38]
Testing
Gaps
()
Check Answer
Spots
1scores = [72, 85, 90
2total = 0

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Woodland Hedgehog' badge — Import Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How do you set a breakpoint in most code editors?
A. Click in the margin beside the line number ✓
B. Type the word breakpoint at the end of the line
A breakpoint is set by clicking beside the line number. It is a marker added by the editor, not code you write.
2. What does a breakpoint do when the program runs in debug mode?
A. Deletes that line so the program skips it
B. Pauses the program at that line so you can inspect it ✓
The program pauses at the breakpoint. You can then check variable values and step through the code.
3. Which way of running your program will actually stop at a breakpoint?
A. Running in debug mode ✓
B. Running normally with the standard Run button
Breakpoints only pause the program when you run it in debug mode. A normal run ignores them.
4. Your loop gives a wrong total after several passes. Where is the best place to set a breakpoint?
A. On the very first comment at the top of the file
B. On the line inside the loop that updates the total ✓
Place a breakpoint where you can see the values change. The line that updates the total shows you each pass.
5. How do you remove a breakpoint?
A. Click the same marker beside the line number again ✓
B. Delete the whole file and start again
Clicking the marker again toggles the breakpoint off. Your code stays unchanged.

Match the Pairs

Click beside line 12 → Sets a breakpoint on line 12 so the program will pause there
Click the red dot on line 12 → Removes the breakpoint from line 12
Place a breakpoint on the line just before a suspected bug so you can inspect variables before the fault happens → total = total + price # breakpoint here, before the wrong total is printed
A conditional breakpoint only pauses the program when a condition is true → Breakpoint on line 8 with condition: i == 50
Run the program normally, then expect it to pause at the breakpoint on line 5 → Breakpoints only pause the program when it is run in debug mode. A normal run ignores them, so the program never stops.
Set the breakpoint on a comment line: # check the total → A comment is not executed, so the program can never pause there. The breakpoint must go on a line of real code.

Key Term

breakpoint
A marker set on a line of code (click beside the line number) that pauses the program there in debug mode, so you can inspect variables and step through the code.

Fill in the Blanks

1. total = 0 breakpoint() print(total)
Hint: Type the built-in function name that pauses the program here so you can inspect it in debug mode.
2. if score > 100: breakpoint()
Hint: Type the comparison operator so the pause only happens when the score is above the limit (a conditional breakpoint).
3. if count == 0: breakpoint() average = total / count
Hint: Type the comparison operator that tests whether count is equal to zero, so the program pauses just before the risky divide line.
4. for mark in marks: total += mark breakpoint()
Hint: Type the function name that pauses on every pass of the loop so you can watch total change.
5. for i in range(10): if i == 7: breakpoint()
Hint: Type the keyword that makes the pause happen only when a condition is true.

Spot the Error

Question 1
A scores = [72, 85, 90
B total = 0
C for s in scores:
D breakpoint()
E total = total + s
Line A — The list is missing its closing bracket ]. This is a syntax error, so the program never starts and never reaches the breakpoint. It should be scores = [72, 85, 90].
Question 2
A price = 20
B qty = 3
C if qty > 2
D breakpoint()
E price = price * 0.9
Line C — The if line is missing its colon. This is a syntax error, so the conditional breakpoint inside the if block can never be reached. It should be if qty > 2:
Question 3
A for i in range(1, 11):
B total = i * 2
C if i == 5:
D breakpoint
E print(total)
Line D — breakpoint is only named, not called. Without the brackets the program never pauses at i == 5. It should be breakpoint().
Question 4
A def average(a, b):
B total = a + b
C Breakpoint()
D return total / 2
Line C — Python is case-sensitive. Breakpoint with a capital B is not a built-in function and causes a NameError. It should be breakpoint().
Question 5
A age = int(input("Age: "))
B if age = 0:
C breakpoint()
D print("Age is", age)
Line B — A single = assigns a value and is not allowed in an if condition, so it is a syntax error. To compare for the breakpoint condition use ==: if age == 0:

Student with a class code? Join your class →