What does SyntaxError: python missing parentheses in call to 'print' mean in Python?

969    Asked by RutujaMishra in Python , Asked on Apr 3, 2021

Why print statement in python giving python syntaxerror: missing parentheses in call to 'print'

>>> print "Hello, World!"

File "", line 1

print "Hello, World!"

^

SyntaxError: Missing parentheses in call to 'print'

Why so? and what does that mean?

Answered by Rutuja Mishra

While running the above code if you are getting this “SyntaxError: Missing parentheses in call to 'print'” error it means there is a syntax error.

If you are using Python 3 you need to add parentheses around the value to be printed like mentioned in the following piece of code:-

print("Hello, World!")

 If you do not want to get this error run this code in Python 2 as shown:

print "Hello, World!"

Note: print () statement is a function in Python 3 and greater versions so you need to put the parentheses while in Python 2 and lower versions it is just a statement so there is no need for parenthesis.



Your Answer

Interviews

Parent Categories