Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def query_yes_no(question, true='yes', false='no'):
- while True:
- print (question + ' [' + true[0] + '/' + false[0] + ']'),
- choice = raw_input().lower()
- if choice in (true, true[0]):
- return True
- if choice in (false, false[0]):
- return False
- else:
- print "Please respond with '" + true + "' or '" + false +\
- "' (or '" + true[0] + "' or '" + false[0] + "').\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement