Newbie coding question
Emile van Sebille
emile at fenx.com
Thu Jun 26 16:05:40 EDT 2014
On 6/26/2014 11:53 AM, Martin S wrote:
> Hi,
>
> I've been following the tutorial here
> http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/
> But when I get to section 1.10 there is
>
> person = input('Enter your name:')
>
> However this generates an error
>
>
> >>> person = input('Enter your name: ')
> Enter your name: hi
>
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in <module>
> person = input('Enter your name: ')
> File "<string>", line 1, in <module>
> NameError: name 'hi' is not defined
> >>>
>
> I have no idea what I am doing wrong with this - it look correct to me.
>
> I'm obviously doing something stupid, anyone can suggest what?
I'd guess you're running Python2, and need to be running Python3.
Emile
More information about the Python-list
mailing list