Question: PYTHON Dr. Dos plays the Palmetto Cash 5 every Wednesday night. The game consists of picking five numbers draw from 1 to 38 (without replacement).
PYTHON
Dr. Dos plays the Palmetto Cash 5 every Wednesday night. The game consists of picking five numbers draw from 1 to 38 (without replacement). Dr. Dos plays the same numbers each week, found in the file dosNumbers.txt: Create a code that
Reads in and stores Dr. Dos's numbers in a list (do not hard-code a size for the file, determine in on the fly).
Picks 5 random numbers from 1 to 38 (drawn without replacement) and puts them into a list.
Sorts the list from lowest to highest.
Performs a search to see if any of the 5 sets of 5 Dr. Doss numbers match.
If a set of numbers match, prints out the matched set. If the numbers do not match, repeats the process.
Prints out how many draws it took until a match was found (in my tests it generally took between 100,000 and 200,000 trials).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
