What is the name of Python's built-in function to display output to the console?

The story behind the answer

Python’s built-in function for displaying output to the console is print.

A basic call such as print("Hello") converts its arguments to text and writes them to standard output, normally the terminal or an interactive interpreter. It can accept multiple arguments, placing a separator between them, and it normally adds a newline after the output. The sep and end parameters customize those behaviors, while file can redirect output to another stream, such as an open file.

Python 3 made print a regular built-in function rather than Python 2’s print statement. That change enabled ordinary function arguments and options, including print("A", "B", sep="-") and print("working", end="..."). In Python 2.6 and 2.7, print() syntax was available but interacted with the older statement form; future imports helped developers adopt the newer behavior.

print is not the same as logging. It is convenient for quick feedback, scripts, and teaching, while the logging module provides levels, timestamps, handlers, and configurable destinations for production diagnostics. The related input() function performs the opposite broad task: it reads a line from the user.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: