Print function in Python

Syntax of print () function

print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

It prints the values to a stream or to sys.stdout by default.

Optional keyword arguments are,

  • file a file-like object (stream); defaults to the current sys.stdout.
  • sep string inserted between the values, default is a space.
  • End string appended after the last value, default is a newline.
  • Flush whether to forcibly flush the stream or not.

Comments