Question: 1 . Using the partial code on the following page, write a function named play lotto ( ) that simulates a lottery where players try
Using the partial code on the following page, write a function named
play lotto that simulates a lottery where players try to predict a
sequence of randomly drawn numbers. Follow the guidelines below.
a The first parameter of the function should be named picks and it
should be variadic.
Note: This parameter represents the numbers that the player picks.
Since it is variadic, the player may pick how ever many numbers they
would like and the function will simulate a lotto with that many win
ning numbers
b The second parameter of the function should be named max and it
should have a default value of
c Give the function a descriptive docstring.
d Import the function from the random module that we have used to
make multiple random selections from a collection where
repetition is not allowed.
e Assign the variable n to be the length of the tuple named picks.
f Using the function you imported in part d randomly select n numbers
that can range from to max.
g In the ifblock, bump up the value of matches by
Use the function to simulate a pick lottery, leaving the max value to be
its default value.
Use the function to simulate a pick lottery with a max value of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
