Python 3 print without parenthesis

454    Asked by AadityaSrivastva in Python , Asked on Apr 14, 2021

The print used to be a statement in Python 2, but now it became a function that requires parenthesis in Python 3.

Is there any way to suppress these parentheses in Python 3? Maybe by re-defining the print function?

So, instead of

print ("Hello stack over flowers")

I could type:

print "Hello stack over flowers"

Using python print without parentheses is invalid it can be done in Python 2 see the examples below:-

Python 2:

>>> print abc

Python 3:

>>> print(“abc”)



Your Answer

Interviews

Parent Categories