"Keith Lucas" <k...@aber.ac.uk> wrote

What is wrong with the following, apparently almost straight out of Python Programming
by Michael Dawson?


You are using Python v2, the tutorial seems to be written for v3.
There are big diffeernces in syntax between them, v3 is NOT
backwards compatible with v2.

# Get value.
name = input("What is your name? ")

In v2 that would be

name = raw_input("What is your name")

Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32 Type
"copyright", "credits" or "license()" for more information.
================================ RESTART ================================
What is your name? Keith

I think there is a trick in V2.7 to make it act more like v3 but someone
else will need to tell you what it is... :-)

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


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

Reply via email to