How about doing it this way:
def is_yes(question):
yn = { 'y':True, 'yes':True, 'n':False, 'no':False }
while True:
try:
return yn[raw_input(question).lower().strip()]
except KeyError:
print '\nplease select y, n, yes, or no\n'
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor
