Chapters
Python114 chapters

ReferenceBuilt-in functions

print()

Writes values out, separated by spaces and followed by a newline.

Signature

print(*values, sep=' ', end='\n', file=sys.stdout)

Parameters

NameMeans
*valuesany number of things to show
sepput between them
endput at the end
filewhere to write; an open file works

Returns

None.

Example

Python
print("a", "b")
print("a", "b", sep="-")
print("no newline", end=" -> ")
print("same line")

Output

a b
a-b
no newline -> same line

See also