Skip to main content

Python: Output using print() Function

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


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

print() Parameters

  • objects - Any Object is converted to string.
  • sep - It specify how to separate the objects, if there is more than one.Default :’ ‘ 
  • end - It specify what to print in last.
  • file - must be an object with write(string) method. If omitted it, sys.stdout will be used which prints objects on the screen.
  • flush - A Boolean, specifying if the output is flushed (True) or buffered (False).

Return Value from print()

It returns output to the screen.


print("Hello", "how are you?")

Output: Hello how are you?

Submitted by devanshi.srivastava on July 1, 2021

Devanshi, is working as a Data Scientist with iVagus. She has expertise in Python, NumPy, Pandas and other data science technologies.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.