Python print() function

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

Syntax

Parameter

objects: This function represents an object, which will be converted to a string before printed.

sep: It is an optional parameter that specifies how to separate the objects if there is more than one. The default value of this function is ‘ ‘

end: It is an optional parameter that specifies what to print at the end. The default value of this function is ‘\n’.

file: This parameter represents an object with a write method, and by default,its value is sys.stdout.

flush: It is an also an optional parameter which represents a Boolean value, specifying if the output is flushed (True) or buffered (False). The default value of this attribute is False.

Return

This function returns output to the screen.

Example 1

Output

Pin It on Pinterest

Share This