Problem

Description

Rock Paper Scissors
Let's play! You have to return which player won! In case of a draw return Draw!.

Test Cases

"scissors", "paper" --> "Player 1 won!"
"scissors", "rock" --> "Player 2 won!"
"paper", "paper" --> "Draw!"

Solution

My Solution

def rps(p1, p2):
    combos = [("scissors", "paper"), ("paper", "rock"), ("rock", "scissors")]
    if p1 == p2:
        return("Draw!")
    for i in combos:
        if (p1,p2) == i:
            return "Player 1 won!"
    else:
        return "Player 2 won!"

Other Solutions

Learning Experiences