English · Dansk · Bahasa Melayu
Debugging
Six small exercises on finding and fixing bugs in Python code.
What is it?
Day 13 of the Udemy course 100 Days of Code: The Complete Python Pro Bootcamp. All exercises live in src/main.py, each commented out with the fix noted beside it. Uncomment one at a time to run it.
What the exercise teaches
- Describing a problem in your own words and reproducing the bug
- Playing computer: stepping through code by hand
- Reading the errors the interpreter reports and fixing them
- Using print() and a debugger to inspect values
What it does
- Six exercises: Describe the Problem, Reproduce the Bug, Play Computer, Fix the Errors, Print is Your Friend and Use a Debugger
- Each exercise names the bug and shows the fix
- Typical beginner bugs: an excluded range bound, an index off by one, a missing comparison case, a string used as a number, == instead of = and a statement outside a loop
Next