I'm working my way through Mr Lutz's "Learning Python", and I come to
this snippet (page 271):
while True:
reply = input('Enter text:')
if reply == 'stop': break
print(reply.upper())
which works "as advertised" in an interactive session, but not in a
script. Yes, I tried tossing the script to both versions of
interpreter, it doesn't work with either 2.6 or 3.1.
text given as input results in NameError: name 'text' is not defined.
numerical input results in AttributeError: 'int' object has no attribute
'upper'
either way, enclosing the input in quotes works.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor