Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON PLEASE DO NOT COPY AND PASTE FROM PREVIOUS CHEGG ANSWERS I NEED UNIQUE ANSWERS Write a function that will play Rock, Paper, Scissors (RPS)

PYTHON

PLEASE DO NOT COPY AND PASTE FROM PREVIOUS CHEGG ANSWERS I NEED UNIQUE ANSWERS

image text in transcribedimage text in transcribed

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'] 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 Write a program that creates two threads. The first thread will ask the user to enter three students names and ids and put them in two lists namel and idl, the second thread must use namel and idl lists to generate the students' emails and put then in a list called emails, student email has the first three letter of the email with his/her id followed by @std.psut.edu.jo. enter your name: Yasmeen enter your ID: 111111 enter your name: Ali enter your ID: 2222222 enter your name: Sama enter your ID: 3333333 ['Yas1111111@std.psut.edu.j', 'Ali2222222@std.psut.edu.j', 'Sam3333333@std.psut.edu.j']

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

Students also viewed these Databases questions