Question: Hello, I have this code written. I need to adapt this code: import random #allows Python to pick random numbers def lotteryNum(M): #defining the function

Hello,

I have this code written. I need to adapt this code:

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

And fit it in with this code:

def main(): M=1 while M

main()

The first code needs to be inserted below "for n in range (1,nTrials+1):

You should get the answer that looks like this:

Hello, I have this code written. I need to adapt this code:

Enter M, the Lottery Range Greater Equal To 5 39 Enter the number of Times to Play the Lottery 10 N8 (0: 48333816, 1: 40269988, 2: 10394198, 3: 972492, 4: 29337, 5 169) logout<:>

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!