Ad
Sets
Code
Diff
  • def dumbRockPaperScissors(player1, player2):
        winning_combos = {"Rock": "Scissors", "Paper": "Rock", "Scissors": "Paper"}
        if winning_combos.get(player1) == player2:
            return "Player 1 wins"
        elif winning_combos.get(player2) == player1:
            return "Player 2 wins"
        else:
            return "Draw"
    • def dumbRockPaperScissors(player1, player2):
    • Rock = {"Paper"}
    • Paper = {"Scissors"}
    • Scissors = {"Rock"}
    • if player1 in eval(player2):
    • winning_combos = {"Rock": "Scissors", "Paper": "Rock", "Scissors": "Paper"}
    • if winning_combos.get(player1) == player2:
    • return "Player 1 wins"
    • elif player2 in eval(player1):
    • elif winning_combos.get(player2) == player1:
    • return "Player 2 wins"
    • else:
    • return "Draw"
    • return "Draw"