Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python answer question 2 and 3 last two pictures are txt files Lab Exercises: 1. Write a function that will play Rock, Paper, Scissors with

python
answer question 2 and 3
last two pictures are txt files image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Lab Exercises: 1. 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. 2. Write a program that creates three threads. The first thread will ask the user to enter a string, the second thread will also ask the user to enter another string and the third thread must find the shared letters between both strings and insert them into a list called shared_letters, then print the list. Please note that the strings are case sensitive, meaning that A doesn't equal to a etc. You must use either python global variables or a Queue. 3. Using Python threads and the module hashlib, write an MD5 Cracker. Your script must read the file hash.txt (this file contains a single hash that needs to be cracked) and the file wordlist.txt (this file contains a list of possible words that could be the hash) to try and break the hash. "Hashing is the process of converting a given key into another value. A hash function is used to generate the new value according to a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash." Example of an MD5 Hash is 'cc03e747a6afbbcbf8be7668acfebee5' which is the word 'test123' To generate the MD5 hash of a string, you can use the following code: \# Import module import hashlib \# The string STRING = 'test 123 ' \# Generate Hash hash = hashlib.md5(STRING.encode() ) hexdigest () \# Print hash print (hash) \#This will output cc03e747a6afbbcbf8be7668acfebee5 2a2a3e380c3d21c6b898cc44adb98167 Hash.txt

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

More Books

Students also viewed these Databases questions

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago