Question: I've started writing this code for a lottery generator. Here is what the question asks for: Can you help me modify my code to make
I've started writing this code for a lottery generator. Here is what the question asks for:

Can you help me modify my code to make this work? I feel like I'm on the right path. Appears to be something wrong with my line: lotteryNum.append(random.randint(M))
import random
def lotteryPick(M): if M=5:
lotteryNum=[]
for i in (range (1,M+1),5): lotteryNum.append(random.randint(M)) return lotteryNum print ('The Lucky Numbers are:').format(lotteryPick())
Lottery games award players for money if they are able to match two, three four or five integers from integers selected at random in a range 1 to M (inclusive of M). Simulate a lottery game by designing a well-documented Python function, lotteryPick(M) that accepts an integer greater than five and returns a list of randomly selected integers. You will need to use Python's random module. Also, consider using the sample function embedded in the random module. Your call to sample should be of the form sample(range(1, M+1),5). In addition, your function should NOT return a value when the user selects an M less than 5. Under this condition have your function return an empty list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
