Guest User

Untitled

a guest
Dec 15th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def ask_user(question, choice_1, choice_2, error_msg):
  2. letsplay = False
  3. print question + ' ('+ choice_1 + '=yes, ' + choice_2 + '=no):'
  4. answer = raw_input()
  5. while letsplay == False:
  6. if answer == choice_1 or choice_2:
  7. if answer == choice_1:
  8. letsplay = True
  9. break
  10. elif answer == choice_2:
  11. letsplay = False
  12. print 'Quitting game.'
  13. sys.exit()
  14. else:
  15. print error_msg
  16. answer = raw_input()
  17. return answer
Add Comment
Please, Sign In to add comment