Problem 4 (100pts)

Implement swine_swap, which takes the current player and opponent scores and returns True if the scores of both players will be swapped due to Swine Swap.

  • Swine Swap. Define the excitement of the game to be three to the power of the sum of both players' scores. After points of the turn are added to the current player's score, if the excitement's first digit and last digit are the same, the scores of both players should be swapped.

Before writing any code, unlock the tests to verify your understanding of the question.

$ python ok -q 04 -u

Once you are done unlocking, begin implementing your solution. You can check your correctness with:

$ python ok -q 04