Console output
Display status, results, or diagnostic information during a script run.
Python · Function
Writes zero or more objects to a text stream, separating them with sep and ending with end. The destination and flushing behavior can be customized with keyword-only arguments.
Call print() with zero or more objects. Python converts the objects for text output, joins them with sep, appends end, and writes the result to file; flush=True requests an immediate flush of that stream.
print(*objects, sep=' ', end='\n', file=None, flush=False)| Name | Type | Description |
|---|---|---|
*objects | object | Objects to convert and write; any number may be supplied. |
sep | str or None | Text inserted between objects; defaults to a single space. |
end | str or None | Text appended after the final object; defaults to a newline. |
file | object with write method or None | Text stream receiving the output; defaults to standard output. |
flush | bool | Whether to flush the output stream immediately; defaults to False. |
Returns None.
print("status", 200, sep=": ", end="\n")Prints two values with a custom separator and the default line ending.
Display status, results, or diagnostic information during a script run.
Control spacing or line endings when composing text output.
Send output to a writable text stream instead of standard output.
str()repr()input()sys.stdout