IT 280 - Lab \#2: Guessing Game (Rock, Paper, Scissors, Lizard, Spock) Instructions To Submit This Program In IDLE, choose File -> NewFile. Type your program in the window that pops up, saving it as you work. The file name should be your Last Name, followed by Lab 2.2.py in a Python program. Test the program by running it (F5 or Run→Run Module). Program Inputs: Ask the user for their choice (Rock, Paper, Scissors, Lizard, Spock) - (This can be done through a menu choice or in any other way). The program will randomly choose one of the five possibilities. (Generate random numbers in Python). The program will generate the winner and an appropriate statement based on the following:✓Rock crushes Lizard✓Rock destroys Scissors✓Paper disproves Spock✓Paper covers Rock✓Scissors cuts Paper✓Scissors decapitate Lizard✓Lizard eats Paper✓Lizard Poisons Spock✓Spock smashes Scissors✓Spock vaporizes Rock The user will then be asked if they want to play again, and the process repeats until they choose to stop playing. Please correct and complete this phyton code so that it performs the task outlined above. import random def get_choice(): \# This function gets the user's choice of move. choice = inputi,"Enter your choice (Rock, Paper, Scissors, Lizard, Spock):") choice=choice.lower') if choice in ["rock", "paper", "scissors", "lizard", "spock"]: return choice else: print("Invalid choice. Try again. ") return get_choice() def get_computer_choice(): \# This function gets the computer's choice of move. choices = ["rock", "paper", "scissors", "lizard", "spock"] return random.choice(choices) def get_winner(player_choice, computer_choice): \# This function determines the winner of the game. if player_choice==

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

IT 280 - Lab \#2: Guessing Game (Rock, Paper, Scissors, Lizard, Spock) Instructions To Submit This Program In IDLE, choose File -> NewFile. Type your program in the window that pops up, saving it as you work. The file name should be your Last Name, followed by Lab 2.2.py in a Python program. Test the program by running it (F5 or Run→Run Module). Program Inputs: Ask the user for their choice (Rock, Paper, Scissors, Lizard, Spock) - (This can be done through a menu choice or in any other way). The program will randomly choose one of the five possibilities. (Generate random numbers in Python). The program will generate the winner and an appropriate statement based on the following:✓Rock crushes Lizard✓Rock destroys Scissors✓Paper disproves Spock✓Paper covers Rock✓Scissors cuts Paper✓Scissors decapitate Lizard✓Lizard eats Paper✓Lizard Poisons Spock✓Spock smashes Scissors✓Spock vaporizes Rock The user will then be asked if they want to play again, and the process repeats until they choose to stop playing. Please correct and complete this phyton code so that it performs the task outlined above. import random def get_choice(): \# This function gets the user's choice of move. choice = inputi,"Enter your choice (Rock, Paper, Scissors, Lizard, Spock):") choice=choice.lower') if choice in ["rock", "paper", "scissors", "lizard", "spock"]: return choice else: print("Invalid choice. Try again. ") return get_choice() def get_computer_choice(): \# This function gets the computer's choice of move. choices = ["rock", "paper", "scissors", "lizard", "spock"] return random.choice(choices) def get_winner(player_choice, computer_choice): \# This function determines the winner of the game. if player_choice==computer_choice: return "tie" elif player_choice =e "rock": if computer_choice=="scissors" or computer_choice=="lizard": return "player" else: return "computer" if player_choice=="paper". if computer_choice == "rock" or computer_choice == "spock": return "player" else: return "computer" elif player_choice=="scissors": if computer_choice==" paper" or computer_choice==" lizard" : return "player" else:

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education