Prompt the user to enter their choice.
()
| 8 | |
| 9 | |
| 10 | def get_user_choice(): |
| 11 | """Prompt the user to enter their choice.""" |
| 12 | choice = input("Enter your choice (rock, paper, scissors): ").lower() |
| 13 | if choice in ["rock", "paper", "scissors"]: |
| 14 | return choice |
| 15 | else: |
| 16 | print("Invalid choice! Please enter rock, paper, or scissors.") |
| 17 | return get_user_choice() |
| 18 | |
| 19 | |
| 20 | def get_computer_choice(): |