Question: Python The game of rock-paper-scissors is played between two players. The game is played as follows: each player chooses one of either rock, paper, or

Python
The game of rock-paper-scissors is played between two players. The game is played as follows: each player chooses one of either rock, paper, or scissors, without knowledge of what the opposing player will choose. When both players have made their choice, the winner of the round is determined by the following rules: . scissors beats paper . paper beats rock, . rock beats scissors, . otherwise, the round has no winner Write a function named rock_paper_scissors, having signature () -> NoneType, that will play a game of rock-paper-scissors. In our version of the game, the user will play against the computer. This means that the computer will randomly select rock, paper, or scissors; the user will select rock, paper, or scissors; and then your program will announce a result, according to the rules above. A typical execution might look like this Please enter rock, paper, or scissors: rock Computer selected: scissors Rock beats scissors. You win! Here's another example Please enter rock, paper, or scissors: paper Computer selected: paper Both players choose paper. No winner! Test your program thoroughly before submitting it. Make sure that it produces correct results for all possible cases Hint: in order to let the computer randomly select its move, use the random.randint function. You can use it to randomly select an int between 0 and 2, inclusive, such that 0 signifies rock, 1 signifies paper, and 2 signifies scissors. You may not use random.choice in this program Hint: use the input function to prompt the user for their move. You may assume that the user is cooperative, and will definitely type either rock, paper, or scissors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
