Answered step by step
Verified Expert Solution
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
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 dictionaryStep 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