Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

He also gave us one example of Random Number Generater python file: Powerball In each game, players select 5 numbers from a set of 69

image text in transcribed

He also gave us one example of "Random Number Generater" python file:

image text in transcribed

Powerball In each game, players select 5 numbers from a set of 69 white balls and 1 number from 26 red Powerballs; the red ball number can be the same as 1 of the white balls. In each drawing, winning numbers are selected using 2 ball machines, 1 containing the white balls and the other containing the red Powerballs. Five white balls are drawn from the 1st machine and the red ball from the 2nd machine Write a Python program to pick your Powerball numbers, adding them to a list. The first five elements of the list correspond to the five white balls, while the final list element corresponds to the red Powerball. The white balls are numbered from 1 to 69, and once a number is picked will appear only once in the first five picks. The final Powerball pick is from a different pool of 26 red balls, numbered from 1 to 26. The red Powerball number may duplicate one of the first five numbers. Once the numbers have been picked, print them and exit. CK:Windows system321cmd.exe K:\Users\CIS\Desktop>Powerball [1, 5, 29, 36, 50, 25] K:\Users\CIS\Desktop>Powerball [20, 23, 45, 56, 66, 22] K:\Users\CIS\Desktop>Powerball [15, 19, 21, 33, 66, 16] K:\Users\CIS\Desktop>Powerball [21, 30, 34, 38, 54, 2] K:\Users\CIS\Desktop> As part of your solution, define pick_ball and pick_powerball functions, passing to them your list of picks. Each function should pick a random number in the appropriate range and add it to the end of the list; in the pick_ball function, you must insure that the number you pick is not already in the list. In my solution, I sort the list after l've generated the first five random picks, making it easier to see that there are no duplicate picks. The first lines in every assignment should consist of a comment block as follows: CIS 222 Computer Scripting Powerbal1 Quick Pick # Course: 2 # Project: 3 # Written by: Your Name 4 # Date: 20 September 2018 Please name your source file Powerball.py, and when you are ready to submit your assignment, upload it by clicking the Submit Assignment Feel free to leave any comments, and then click on the button at the top of this page. Click on "Browse" in the "File Upload" section and navigate to select your source file Submit Assignment button to submit your assignment for grading

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

Can resale price maintenance have anti-competitive effects?

Answered: 1 week ago

Question

Who is eligible to telecommute?

Answered: 1 week ago