print()

The built-in function that writes values to the screen, separated by spaces and followed by a newline.

In more detail

print takes any number of arguments, converts each to a string and writes them with sep between them and end after them; the defaults are a space and a newline. In the shell a bare expression shows its value, but a program must call print to display anything. In Python 2 print was a statement, so old instructions write it without parentheses.

Example

print("a", "b", sep="-", end="!\n")

Related terms

Taught in

References

Certification courses