| 149 | |
| 150 | # Function to determine and display the winner of the match |
| 151 | def who_won(player1_score, player2_score): |
| 152 | print("\nMatch Result") |
| 153 | print("============") |
| 154 | print("Player 1's score =", player1_score) |
| 155 | print("Player 2's score =", player2_score) |
| 156 | if player1_score > player2_score: |
| 157 | print("Player 1 won") |
| 158 | elif player2_score > player1_score: |
| 159 | print("Player 2 won") |
| 160 | else: |
| 161 | print("The match ended in a draw") |
| 162 | print("Thank you for playing and have a good day :) ") |
| 163 | |
| 164 | |
| 165 | # Run the main function if the script is executed |