Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python code please: Could any tutor upgrade the rock, paper, scissors game to the rock, paper, scissors, lizard, and Spock game, where the game rules

Python code please:

Could any tutor upgrade the rock, paper, scissors game to the rock, paper, scissors, lizard, and Spock game, where the game rules are shown by the attached picture?

image text in transcribedimage text in transcribed
def rps ( ) : WN The function rps is used to play the rock, paper, scissors game. emojis = emoji_dict( ) LO while True: 10 player = input ( 'Player: ' ) 11 if player=='' or player not in 'rps': 12 print ( ' Game ends . ') 13 break 14 15 computer = rand_rps ( ) 16 print ( 'Player: ', emojis[player], 17 'Computer: ', emojis [ computer ]) 18 19 result = check_win (computer, player) 20 21 if result == 'Win' : 22 print ( 'You win. ' ) 23 elif result == 'Lose': 24 print ( 'You lose. ') 25 else : 26 print ( "Tie game" ) 27 28 print ( ' \ ' )Rock, Paper, Scissors, Lizard, Spock - Scissors cuts paper - Paper covers rock - Rock crushes lizard - Lizard poisons Spock - Spock smashes scissors - Scissors decapitates lizard - Lizard eats paper - Paper disproves Spock - Spock vaporizes rock - And, as it always has, rock crushes scissors

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

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

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions