Question: I need help with this: Here is what I have so far: import random #allows Python to pick random numbers def lotteryNum(M): #defining the function

I need help with this:

I need help with this: Here is what I have so far:

Here is what I have so far:

import random #allows Python to pick random numbers

def lotteryNum(M): #defining the function lotteryPick=[] #Stores the lottery numbers if M=5: #if they are greater or equal to 5, lottery sample will pick through the range lotteryPick= random.sample(range(1,M+1),5) return lotteryPick

Test your function inside the main program lottery.py. Your main program should ask the user for an integer M representing the range M for the lottery. The program should test to ensure the integer is greater than or equal to 5. If not, the program should continue to query the user. Next, your program should call lotteryPick(39) one time to represent your "Quick Pick". A "Quick Pick" represents a random selection made by you. Next, have your main program call lotteryPick(39) again to represent the actual drawing. In addition, have the main program test whether or not your "Quick_Pick" has won by testing if zero, one, two, three, four or five matches have been made - and displaying the result. Finally, ask the user if they would like to play the program again with a "y prompt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!