Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with following python code We are going to code the game 'Rock Paper Scissors.' Just in case you have forgotten, here is the

image text in transcribed

Need help with following python code

We are going to code the game 'Rock Paper Scissors.' Just in case you have forgotten, here is the logic: Image by MIT Open Courseware Your last task is to write the code for the game. You will have two variables, player1 and player2. Use the input function in Python to capture the value from the user and assign to a variable. Test the input values to make sure that they are valid (one of the three valid values), and if not, alert the user and do not execute the game. Assign each variable with one the three possible values. Then write the code to print the result to the output. For example, suppose that: player1 == 'rock' player2 == 'paper' According to the rules, paper beats rock, so player 2 should win. Your code should account for all possible combinations. It might help to create a table with all possible combinations of player 1 and player 2 values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions