Skip to main content
Loading page…
Python Mastery
Chapter 54
Lesson 3 of 4
Debugging Missions
Contents
Notes
Tutor
Concept
The Debugging Mindset
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
25 min
9 activities
0 of 9 done
In this lesson
1
The Debugging Mindset
2
Mission 1 — Off-by-One (find_max)
3
Mission 2 — Mutable Default Argument (append_to)
4
Mission 3 — Wrong Scope (counter)
5
Mission 4 — Swallowed Exception (safe_divide)
6
Mission 5 — `==` vs `is` (check_empty)
7
Mission 6 — Integer Division (average)
8
Mission 7 — Infinite Loop (find_index)
9
Match the Bug to Its Fix
Objectives
Learner can identify and fix off-by-one errors in loop bounds
Learner can explain why mutable default arguments are dangerous and how to fix them
Learner can correct scope bugs involving the global keyword
Learner can recognise a swallowed exception and rewrite the handler correctly
Learner can distinguish `==` (equality) from `is` (identity) and avoid the `is` trap
Learner can fix integer division errors (// vs /)
Learner can identify and break an infinite loop caused by a logic error
Chapter 54 · Coding Challenges, Katas & Debugging
String & Array Katas
Recursion & DP Challenges
Debugging Missions
Refactoring & Code Review
Previous: Recursion & DP Challenges
Next: Refactoring & Code Review