Loading...
Loading...
Loading...
Two players each choose rock, paper or scissors. Rock beats scissors, scissors beats paper and paper beats rock. The same choice is a draw.
Given the choices of player 1 and player 2, print Player 1 wins, Player 2 wins or Draw. If either choice is not one of the three words, print Invalid.
Player 1 wins, Player 2 wins, Draw, Invalid.Example 1
Input
rock scissors
Output
Player 1 wins
Example 2
Input
paper scissors
Output
Player 2 wins
Try the problem first. Open one hint at a time.
Reject unknown choices first. Compare each choice with the three words using or.
Then check for a draw, then list the three ways player 1 can win. Everything else is a win for player 2.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor