Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please USING PYTHON please USING PYTHON please USING PYTHON 1. Write a function that will play Rock, Paper, Scissors (RPS) with the values (list) passed

please USING PYTHON
please USING PYTHON
please USING PYTHON
image text in transcribed
1. Write a function that will play Rock, Paper, Scissors (RPS) with the values (list) passed from the player. For each player's choice, the function will pick a random choice (rock, paper, scissors) and then compare it with the player's value to determine if the player won, lost, or drew. The result should be stored in one dictionary that contains all information for any player who calls the function. The list is rps=['rock', 'paper', 'scissors'] In the main, create two lists representing 10 choices for each player. The choices are random. Then create two threads, each with the player's name as the thread name, and pass the player's 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 must use the random module and the random.choice(LISTNAME) to pick a random element from a list. It would be best if you used a 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_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

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions

Question

=+3. How appropriate would it be to conduct additional research?

Answered: 1 week ago

Question

5. If yes, then why?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago