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.


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

Output: 1

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

Output: ['python','language']

Output: 5