Question: Can you modify this code? I need it To estimate the probability of winning with only one match, for example, have your code count the

Can you modify this code? I need it To estimate the probability of winning with only one match, for example, have your code count the number of times one match is found in 10N trials and divide it by the number of trials.

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

def main(): #sets a new function M=1 N=5 while M

Can you modify this code? I need it To estimate the probability

import random #allows Python to pick random numbers def lotteryNum (M): #de fining the function lotteryPickz[] #Stores the lottery numbers if M-5: #if they are greater or equal to 5, lottery sample will pick through the range return lotteryPick print ("Error, number must be a5") #Asked to have numbers greater than 5 lotteryPick- random.sample (range(1,M+1),5) def main(): #sets a new function M-1 N-5 while M-5: #if they are greater or equal to 5, lottery sample will pick through the range return lotteryPick print ("Error, number must be a5") #Asked to have numbers greater than 5 lotteryPick- random.sample (range(1,M+1),5) def main(): #sets a new function M-1 N-5 while M<:><:><:>

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!