How do you debug code in python?

Last updated 3 years ago | 1165 views 75     5

Tags:- Python

Using PDB we debug code in python. Some pdb commands include-

  • <b> — Add breakpoint
  • <c> — Resume execution
  • <s> — Debug step by step
  • <n> — Move to next line
  • <l> — List source code
  • <p> — Print an expression

latest python 3.7   we can use breakpoint() to debug code