Python: Print

  • The print function in Python is a function that outputs to your console window whatever you say you want to print out.
  • On your first look, the print function might be rather useless for programming, but it is one of the most widely used functions in Python.

Syntax

Syntax of the print function in Python

print("Write your statement here")

Docstring: print(value, ..., sep=' ', end='\n', file-sys.stdout, flush=false)

Prints the values to a stream, or to sys.stdout by default.

Example

To output string in function, Alphanumeric statement should be inside quotation marks to print.

print("My name is ABC")

Outputs: My name is ABC


To output two statement in single function.

print(123, 'Hi Augury Tech')

Outputs: 123 Hi Augury Tech


To output integers (numbers without point).

print(1000)

Outputs: 1000


To output two integers with one function.

print(123,456)

Outputs: 123 456


To output integer and floating point number in one function.

print(123, 12.3)

Outputs: 123 12.3