[Tutor] Getting confusing NameError

Alan Gauld alan.gauld at btinternet.com
Wed Aug 18 10:37:02 CEST 2010


"shane brennan" <wiserwaylander at gmail.com> wrote

> In one of the code samples he supplies while doing loops ( namely if 
> and
> else loops) im getting a NameError i dont understand and cannot find 
> any
> help anywhere about it.

Evert has already pointed out that the code is for Python v3 and it
looks like you are using Python v2.

If your other book is based on v2 then using the two side by side will
be confusing. If both are on v3 then you need to upgrade your Python
to v3. If they are mixed versions then you need to decide on only one
book and follow whichever version it uses.

You can find both v2 and v3 versions of my tutorial on my web site.

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




More information about the Tutor mailing list