On 16/05/18 02:43, Steven D'Aprano wrote:
> The traceback Sam posted says (in part):
> Move = input('What Will You Do? Fight or Run: ')
> File "<string>", line 1, in <module>
> NameError: name 'Run' is not defined
> so the failed line was the call to input(). In Python 3, it would return
> a string. In Python 2, input() evaluates whatever the user types as
> code, hence I infer Sam typed:
> and input() tries to evaluate it, which fails.
I was trying to figure out why the traceback highlighted
that line instead of the if... I never thought about it
being a Python 2 issue.
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options: