Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ask_user(question, choice_1, choice_2, error_msg):
- letsplay = False
- print question + ' ('+ choice_1 + '=yes, ' + choice_2 + '=no):'
- answer = raw_input()
- while letsplay == False:
- if answer == choice_1 or choice_2:
- if answer == choice_1:
- letsplay = True
- break
- elif answer == choice_2:
- letsplay = False
- print 'Quitting game.'
- sys.exit()
- else:
- print error_msg
- answer = raw_input()
- return answer
Add Comment
Please, Sign In to add comment