🛠️Debugger
A tool that stops a program mid-run. You look inside and step through it.
Think of it like
Think of it like a video you can pause. You stop at any moment and look closely at what is going on.
Example
Emma pauses her app just before the total is worked out. She sees price is 0, not 10, and finds the bug on the line above.
Why it matters
Guessing what code does is slow. A debugger shows you what it really does, line by line.
Definition
Example code
console
$ python3 app.py
> app.py(2)<module>()
-> breakpoint()
(Pdb) p price
10Common mistake
Key takeaways
- 1Pause anywhere. Stop the program at a chosen line.
- 2Look inside. See every variable's current value.
- 3Step through. Move one line at a time.