Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

no regular expression and please solve according to question and do not copy from other chegg answers or i will downvote 1. Write a function

image text in transcribed

no regular expression and please solve according to question and do not copy from other chegg answers or i will downvote

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

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

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago