For the complete documentation index, see llms.txt. This page is also available as Markdown.

REPL

Python comes with a full-featured interactive command-line REPL (read-eval-print loop) built into the pythonexecutable. In addition to allowing quick and easy evaluation of Python statements, it has a searchable history, tab-completion, many helpful keybindings, and dedicated help ? and shell modes ;.

This page provides examples of using REPL on the command line

Python REPL Example (local)

  • Type python in terminal to launch REPL

Terminal screen showing Python launched. >>> print("hello world!"),  output = hello world!;  >>> word = "test" >>> print(word), output = test; >>> type(word), output = <class 'str'>; >>> len(word), output = 4; >>> exit()

Python REPL Help Pages (local)

  • Type "help" to enter help pages within REPL

  • Type a function from Python to read help pages (ex:print)

  • Press q to quit

Terminal screen with Python launched. >>> help(print)
Terminal screen with python launched. Output of >>>help(print) = Help on print function

Resources

Last updated