Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP PYTHON 3 (NOT JAVA ) Write a function called rock_paper_scissors_lizard_spock that has two parameters. These arguments for these parameters must be one of the

HELP PYTHON 3 (NOT JAVAimage text in transcribed)

Write a function called rock_paper_scissors_lizard_spock that has two parameters. These arguments for these parameters must be one of the following five strings: 'rock', 'paper 'scissors', 'lizard', 'spock'. The first parameter is the move made by player 1, the second is the move made by player 2. The function must determine which player won, and return the integer 1 if player 1 was victorious, and return the integer 2 if player 2 was victorious. If the game was a tie (both players made the same move) then return the integer 0. You'll need to use conditionals (if, if else, else) to determine which player wins. Write an appropriate docstring for your function in part (a) In the main program (after the function definition) write code to prompt for, and read the players moves from the console. You may assume that the user always enters one of the five strings listed in part (a) that indicate legal moves. Pass the players' moves to the rock_paper_scissors_lizard_spock function and obtain its return value. Use the return value to print a message to the console indicating which player won, or whether it was a tie. You'll need to use conditionals to determine what message to print out

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

What do you really want?

Answered: 1 week ago