Home Dictionary Game About

print() function

The print() function prints the specified message to the screen, or other standard output device.

The message can be a string, or any other object, the object will be converted into a string before written to the screen.


Example

- Print the string "Hello, World!" into the console.

print("Hello, World!")


Syntax


print(object(s), sep=separator, end=end, file=file, flush=flush)

Parameters Table


Parameter Description
object(s) The object(s) that are going to be printed. Will always be converted to a string before outputting
separator Optional. Specifies how to separate the objects, if there are multiple. The Default separator is ' '
end Optional. Specifies what to output at the end of the printed objects. The Default is '\n' (Feeds a new line)
file Optional. An object with a write method. The Default is sys.stdout
flush Optional. A Boolean, specifying if the output is flushed (true) or buffered (false). The Default is false