print statement SyntaxError in Python 3
- SyntaxError
Starting with Python 3.x print changed from a statement to a function. This causes a SyntaxError if the Python 2 statement is used in Python 3.
>>> print 'Cabbage' # Python 2.x
Cabbage
>>> print('Rhubarb') # Python 3.x or 2.x
Rhubarb
>>> print 'Salad' # Python 3.x
SyntaxError: invalid syntax