On 12/15/2010 9:56 AM Alan Gauld said...

"Khalid Akram" <kak...@efinancialcareers.com> wrote

I'm using Python 3.1.3 on Windows XP (using Python Shell).
This is what I am trying:

print 'hello'
...
SyntaxError: invalid syntax

What could possibly be wrong?

You are using a Python v3 interpreter but a Python v2 tutorial.
Python v3 has several new features which are not backward compatible
with v2.


Actually, "the print statement is deprecated" ought not be out of reach. Invalidating every existing python book's first chapter without bias is unfortunate.

Emile




Try

print( 'hello' )

You can either downgrade Python to v2 and follow your tutorial
or find a v3 tutorial. (If you can already program just use the official
one on the Python web site or if you are a new programmer you
might like to try mine :-)



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to