Skip to content

REPL

REPL stands for Read-Eval-Print Loop. It’s an interactive programming environment that allows you to write and execute code in a step-by-step manner and get immediate feedback on how the code works. To access the Python REPL, run the python or python3 command in your terminal or command prompt to launch the Python interpreter.

When you type code into the Python REPL and press Enter, it reads your input, evaluates it, prints the result to the screen, and then loops back to prompt you for more input. This cycle makes the Python REPL incredibly useful for testing code snippets, debugging, and learning new programming concepts interactively.

Using a REPL is a great way to experiment with Python code and see immediate results. As you type in code, the REPL provides instant feedback, which can help you understand how Python works, test functions, or explore new libraries and syntax.

Since Python 3.13, the default REPL has had a major upgrade. It supports multiline editing with history preservation, color-highlighted prompts and tracebacks, and direct help, exit, and quit commands that no longer require parentheses. Dedicated function keys give you interactive help (F1), history browsing that skips prompts and output (F2), and a paste mode for larger code blocks (F3). To fall back to the previous basic REPL, set the PYTHON_BASIC_REPL environment variable.

Example

Here’s how a session in a Python REPL works:

Language: Python
>>> x = 5
>>> y = 10
>>> x + y
15

>>> print("Hello, REPL!")
Hello, REPL!

In this example, you can see how the REPL reads your input, evaluates it to perform computations or execute commands, and then prints the output directly.

Tutorial

The Python Standard REPL: Try Out Code and Ideas Quickly

The Python REPL gives you instant feedback as you code. Learn to use this powerful tool to type, run, debug, edit, and explore Python interactively.

intermediate tools

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated May 15, 2026 • Reviewed by Dan Bader