The breakpoint() function,pauses the program execution and enters the interactive debugger, Pdb.

It can be used to inspect the program state,  to modify values, change the program flow then continue the execution.

The breakpoint() function takes no arguments and does not return any value.

Syntax:

breakpoint()

for example:

breakpoint()
//--Return--
//> <stdin>(1)<module>()->None
//(Pdb)

PDB stands for the Python Debugger , it is defined in the pdb module in the standard library. The debugger provides an interactive prompt for the user to inspect and debug their code. It allows users to step through code line by line, set breakpoints, view or change variables, evaluate expressions, then continue with the execution.

The continue statement is used to leave the debugger and continue with the execution.

Example:

def calculate_sum(x, y):
    breakpoint()
    result = x + y
    return result

sum_total = calculate_sum(2, 3)
//> <stdin>(3)calculate_sum()
//(Pdb)print(x)
//2
//(Pdb)print(y)
//3
//(Pdb)x = x * 2
//(Pdb)y = y * 2
//(Pdb)continue

print(sum_total)
//10