Advertisement
superpawko

Untitled

Oct 8th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. while user_input != "e":
  2. while True: # checking and reacting on first input
  3. user_input = input("Enter n to deal a new hand, r to replay the last hand, or e to end game: ")
  4. try:
  5. if user_input not in ('n', 'r', 'e'):
  6. raise Exception
  7.  
  8. except Exception:
  9. print("Invalid command.")
  10. print("")
  11. else:
  12.  
  13. try: # What if HAND is empty and it can not REPLAY
  14. REMOVED CODE
  15. # Handle exception
  16. if user_input == "e":
  17. break
  18.  
  19. while True: # checking and reacting on second input
  20. user_input2 = input("Enter u to have yourself play, c to have the computer play:")
  21. try:
  22. REMOVED CODE
  23.  
  24. # if inputs are correct continue below
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement