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



# Declare variable and initialise (overkill!).
name = "ABCDEFG"

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

# Echo value
print(name)

# Issue greeting
print("Hi ", 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

Traceback (most recent call last):
  File "C:\Documents and Settings\User\My Documents\My Files\Staff\Keith
Lucas\Education\Python\Learn_Input_01.py", line 5, in <module>
    name = input("What is your name? ")
  File "<string>", line 1, in <module>
NameError: name 'Keith' is not defined




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

Reply via email to