Ubuntu – Python 3 error when running the print command

pythonpython3

All I wrote in the interpreter was as follows:

>>> print "Hello, World!"
  File "<stdin>", line 1
    print "Hello, World!"
                        ^
SyntaxError: invalid syntax

How did I even get an error? All I tried to do was run a print command.

Best Answer

In Python3 print is a function:

print("Hello, World!")

Check: http://docs.python.org/release/3.0.1/whatsnew/3.0.html

Related Question