I have been learning Python and have encountered an error displaying the result of using input
. My mistake still eludes even after: Python Input, Py Docs and many others.
My expected output would be what the user types but instead I get a syntax error on line 7 test_two = input...
# test program
test_one = 'bob'
print (test_one)
print test_one
test_two = input('What is your city? ')
print "City: ", test_two
I am unable to spot what is different to many of the examples I have seen. It seems like its doing an eval
on the entered text?
Traceback (most recent call last):
File ".\test.py", line 7, in <module>
test_two = input('What is your city?')
File "<string>", line 1, in <module>
NameError: name 'Paris' is not defined