0% found this document useful (0 votes)
2 views4 pages

Python Lesson - 1

The document explains the print() function in Python, which is used to display messages on the screen. It outlines the basic syntax and parameters, including objects to print, separators, line endings, file output, and flushing options. A recap emphasizes the key features and usage of the print() function.

Uploaded by

learncs48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Python Lesson - 1

The document explains the print() function in Python, which is used to display messages on the screen. It outlines the basic syntax and parameters, including objects to print, separators, line endings, file output, and flushing options. A recap emphasizes the key features and usage of the print() function.

Uploaded by

learncs48
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.”

You might also like