Python breakpoint()

Python breakpoint() builtin function lets us to enter debugger at this function call site.

In this tutorial, we will learn about the syntax of Python breakpoint() function, and learn how to use this function with the help of examples.

Syntax

The syntax of breakpoint() function is

</>
Copy
breakpoint(*args, **kws)

where

ParameterRequired/OptionalDescription
*argsOptionalArguments.
**kwsOptionalKeywords.

Example

In this example, we will write a Python program to find the largest element of a list. After initializing the list, and before finding the largest, we will call breakpoint() function as shown in the following program.

Python Program

</>
Copy
myList = [24, 0, 8, 6]
breakpoint()
largest = max(myList)
print(largest)

Run this program, and you should enter into Python debugger as shown below.