Debugger (pdb)

say it: “dee-BUG-er” /diːˈbʌɡər/ or “PEE-DEE-BEE” /ˌpiˌdiˈbi/

A tool that pauses your program so you can inspect it line by line.

What is a debugger?

A debugger pauses your program at a line you choose so you can look at the variables and step through the code one line at a time. Python's is called pdb.

def checkout(cart):
    total = sum(cart)
    breakpoint()      # pauses here: type p total, then c to continue
    return total * 1.07

Level: Journeyman · More Python terms at this level

Updated