Python basic program problem

Daniel Kluev dan.kluev at gmail.com
Mon Jun 27 03:19:32 EDT 2011


On Mon, Jun 27, 2011 at 6:05 PM, Amaninder Singh <asingh0412 at gmail.com> wrote:
>>>> print "this is a test"
> SyntaxError: invalid syntax

Most likely, you are running python 3.x, while reading python 2.x book.
In python 3.x print is now ordinary function,

>>> print('hello world')
hello world


In future, please include full tracebacks and python version info.

-- 
With best regards,
Daniel Kluev



More information about the Python-list mailing list