Home Service About Us Contact
print() function
Lesson-1
Home Service About Us Contact
What is print()?
The print() function displays the
specified message to the screen
Hello World !
Home Service About Us Contact
Basic Syntax
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
*objects — what you want to print.
sep='separator' — Optional. Specify how to separate the objects, if there is more than one.
Default is ' '
end — Optional. Specify what to print at the end. Default is '\n' (line feed)
file — Optional. An object with a write method. Default is sys.stdout
flush — Optional. A Boolean, specifying if the output is flushed (True) or buffered (False).
Default is False
Home Service About Us Contact
Recap
Print function
print() shows info on screen.
Use sep to choose separators.
Use end to control line endings.
Use file to write to files.
Use flush for real-time output.”