🛠️Breakpoint
A mark on a line. It tells the debugger to stop the program right there.
Think of it like
Think of it like a bookmark that also stops the reader. When they reach that page, they pause and look around.
Example
Jack clicks beside line 42, where the total is worked out. He runs the app, and it pauses there with all values on show.
Why it matters
A breakpoint takes you straight to the line you care about. You skip the thousands of lines that work.
Definition
Example code
python
price = 10
breakpoint() # the program pauses here
total = price * 2Common mistake
Key takeaways
- 1Pause on a line. The program stops before that line runs.
- 2Set by a click. Click next to the line number.
- 3Take them out. Never ship code that pauses itself.