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: 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started