Syntactically, Python 3.X print function have the following form.
The flush argument is new as of Python 3.3:
print([object, ...][, sep=' '][, end='\n'][, file=sys.stdout][, flush=False])
items in square brackets are optional and may be omitted.
Values after = give argument defaults.
The print method outputs the textual representation of one or more objects separated by the string sep and followed by the string end.
The sep, end, file, and flush parts, if present, must be given as keyword arguments.
You must use a special "name=value" syntax to pass the arguments by name instead of position.
Parameter | Description |
---|---|
sep | a string inserted between each object's text defaults to a single space if not passed; passing an empty string suppresses separators altogether. |
end | a string added at the end of the printed text defaults to a \n newline character if not passed. Passing an empty string avoids dropping down to the next line the next print will keep adding to the end of the current output line. |
file | the file, standard stream, or other file-like object to which the text will be sent; it defaults to the sys.stdout standard output stream if not passed. Any object with a file-like write(string) method may be passed. |
flush | defaults to False. flush through the output stream immediately. |
Each object to be printed is obtained by passing the object to the str built-in call.