Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a function that will play Rock, Paper, Scissors (RPS) with the value passed from the player. The function will pick random elements from

image text in transcribed
1. Write a function that will play Rock, Paper, Scissors (RPS) with the value passed from the player. The function will pick random elements from a list. Then the function must know if passed value from the player element won, lost or draw. The list is rps=['rock', 'paper', 'scissors'] Then the function must add to a dictionary the number of times the first element lose per option in the list. in the main create two lists representing 10 choices for each player, the choices are random. Then create two threads each with the name of the player and pass list to the RPS function. Finally, print the content of the dictionary. Sample output: \{'Yasmeen': \{'win': 5, 'lose': 2, 'draw': 3\}, 'Eman': \{'win': 4, 'lose': 4, 'draw' : 2\}\} You need to use the random module and the random.choice(LISTNAME) to pick a random element from a list. You must use global dictionary

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

More Books

Students also viewed these Databases questions

Question

=+Is the humor funny?

Answered: 1 week ago

Question

Financial Accounting 6e Chapter 4 E4-7

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago

Question

5-8 What are the advantages and disadvantages of the BYOD movement?

Answered: 1 week ago