Decide the winner based on the choices.
(player, computer)
| 23 | |
| 24 | |
| 25 | def decide_winner(player, computer): |
| 26 | """Decide the winner based on the choices.""" |
| 27 | if player == computer: |
| 28 | return "It's a draw!" |
| 29 | elif ( |
| 30 | (player == "rock" and computer == "scissors") |
| 31 | or (player == "paper" and computer == "rock") |
| 32 | or (player == "scissors" and computer == "paper") |
| 33 | ): |
| 34 | return "You win!" |
| 35 | else: |
| 36 | return "Computer wins!" |
| 37 | |
| 38 | |
| 39 | def main(): |