Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions