100 Days Of Python - Day 13
Day 13
Debugging
- Debugging is the process of finding and fixing errors in code.
- The
Python
debugger ispdb
. pdb
is a module that is built intoPython
.- It can be used to set breakpoints in code and step through the code line by line.
pdb
can be used in the terminal or inPyCharm
.- To use
pdb
in the terminal, use thepython3 -m pdb
command followed by the name of the file you want to debug.
Steps in debugging
- Reproduce the bug.
- Find the source of the bug.
- Fix the bug.
- Test the fix.
- Repeat steps 1-4 until the bug is fixed.
- Use
print()
statements to help you find the source of the bug.
This post is licensed under CC BY 4.0 by the author.