Question: Create the constants ROCK, PAPER, SCISSORS and update the code accordingly (i.e. there should only be one 'rock' in your code) Have only a single

  1. Create the constants ROCK, PAPER, SCISSORS and update the code accordingly (i.e. there should only be one 'rock' in your code)

  2. Have only a single exit point in the function. That is there should only be one return statement

  3. Properly name the variable that you return (the one that holds the winner of RPS.

starter code

def winner_RPS(p1, p2): if p1 == p2: return None if (p1 == "paper" and p2 == "rock") or \ (p1 == "scissors" and p2 == "paper") or \ p1 == "rock" and p2 == "scissors"): return p1 return p2

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 Databases Questions!