Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Python by (47.6k points)

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"

1 Answer

0 votes
by (106k points)

Without parenthesis you can not print in Python 3 it is invalid it can be done in Python 2 see the examples below:-

Python 2:

>>> print abc

Python 3:

>>> print(“abc”)

To know more about this you can have a look at the following video tutorial:-


 

Related questions

0 votes
2 answers
0 votes
1 answer
asked Sep 23, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Sep 23, 2019 in Python by Sammy (47.6k points)
+1 vote
2 answers
0 votes
4 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...