Python Print() Function

Print("Hello World!")
Output: Hello World!

Print function is used to print the specified message to the screen.
Message can be string or any other object will converted to the string before output to the screen.

Syntax

print(object(s), sep=separator, end=end, file=file, flush=flush)
  • separator: It is used to seperate the objects. It is optional field and default is ''
  • end: It is used to print at the end. It is optional field and default is '\n'(next line).
  • file: It is optional and field and default is sys.stdout.
  • flush: It is optional and default is False and datatype is Boolean field.

More Sample Codes

Print(1)
Output: 1

Print(('apple','banana','orange'))
Output: ('apple','banana','orange')

Print(['python','language'])
Output: ['python','language']

Print(3+2)
Output: 5