Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python program that lets the user play the game of Rock Plastic Dragon against the computer. The program should work as follows: 1.
Write a Python program that lets the user play the game of Rock Plastic Dragon against the computer.
The program should work as follows:
1. The user enters his choice of rock, plastic or dragon at the keyboard.
2. When the program begins a random number is generated between 10 20 and 30. If the number is 10, computer has chosen dragon, if the number is 20 computer has chosen rock and if 30 computer has chosen plastic.
3. The computers choice is displayed.
4. A winner is selected according to the following rules.
a. If one player chooses rock and other player chooses dragon then rock wins. (Rock smashes dragon.)
b. If one player chooses plastic and other player chooses dragon then dragon wins. (Dragon eats plastic)
c. If one player chooses rock and other player chooses plastic then plastic wins. (Plastic wraps rock)
d. If both players make the same choice the game must be played again to determine the winner.
5. The function should be named as RPDLastName (your lastname in place of lastname).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started