Question: Problem 4 To help you implement the Swine Swap special rule, write a function called is _ swap that checks to see if the last

Problem 4
To help you implement the Swine Swap special rule, write a function called is_swap that checks to see if the last two digits of the players' scores are swapped.
Run the following tests:
$ python3-i hog.py
>>> is_swap(19,91)
True
>>> is_swap(20,40)
False
>>> is_swap(41,14)
True
>>> is_swap(23,42)
False
>>> is_swap(55,55)
True
>>> is_swap(114,41) # We check the last two digits
True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!