Write Python. Understand every error.

Open the editor

Error guide · SyntaxError

SyntaxError: Missing parentheses in call to 'print'

You wrote print the old Python 2 way.

Example

print "Hello"

What Python says

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

As printed by Python 3.12. Other versions may word it slightly differently.

Try this code in Py-CRAFT

Why it happens

In Python 3, print is a function, so its value goes inside brackets. Older tutorials and books written for Python 2 show print "Hello", which no longer works. Python recognises the old style and suggests the fix in the message.

How to fix it

print("Hello")

Output: Hello

Tips

Learn the ideas behind it

Other common errors

Share this page: