Write a function that will play Rock, Paper, Scissors with itself. It will pick two random elements from a list. Then the function must know if random element #1 won, lost or drawed. The list is rps=['rock', 'paper', 'scissors'] Then the function must add to a dictionary the number of times the first element won per option in the list. Example { 'rock':'400', 'paper':'300', 'scissors':'300' } You need to run this at least 1000 times. You can either create a single thread, or you can create multiple threads. You need to use the random module and the random.choice(LISTNAME) to pick a random element from a list.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

PYTHON LANGUAGE

Write a function that will play Rock, Paper, Scissors with itself. It will pick two
random elements from a list. Then the function must know if random element #1
won, lost or drawed. The list is rps=['rock', 'paper', 'scissors']
Then the function must add to a dictionary the number of times the first element
won per option in the list. Example
{
'rock':'400',
"раper:300',
'scissors':'300'
}
You need to run this at least 1000 times. You can either create a single thread, or
you can create multiple threads.
You need to use the random module and the random.choice(LISTNAME) to pick a
random element from a list.
Transcribed Image Text:Write a function that will play Rock, Paper, Scissors with itself. It will pick two random elements from a list. Then the function must know if random element #1 won, lost or drawed. The list is rps=['rock', 'paper', 'scissors'] Then the function must add to a dictionary the number of times the first element won per option in the list. Example { 'rock':'400', "раper:300', 'scissors':'300' } You need to run this at least 1000 times. You can either create a single thread, or you can create multiple threads. You need to use the random module and the random.choice(LISTNAME) to pick a random element from a list.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning