subject

Write a program to simulate a lottery game. (a) Ask the user to pick 4 unique numbers in the range of 1 to 10. Validate the numbers picked by the user to ensure that they are not out of range and they are different. Ask the user to reenter if necessary. Sort and display the numbers picked by the user.
(b) Four balls will be randomly drawn from a pool of 10 balls. These balls are numbered 1 through 10. Simulate this process by using the sample function of the random module. Sort and display the numbers randomly picked by the computer.
(c) Compare the numbers picked by the user in part (a) and the numbers randomly picked by the computer in part (b) to see how many matthes there are. Display the number of matches.
The following is an example. You are asked to pick 4 unique numbers in the range of 1 to 10. Enter a number: 0 Must be in the range of 1 to 10 Enter a number: 11 Must be in the range of 1 to 10 Enter a number: 6 Enter a number: 10 Enter a number: 6 This number has already been picked Enter a number: 5 Enter a number: 2 Numbers picked: (2, 5, 6, 10] Balls drawn: [3, 4, 5, 6] Number of matches: 2 Save your Python program in a file named Labo9P2.py. Submit the file to Blackboard for credit.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
"gps interaction and cognitive process" respond to the following: imagine that you have been asked to design a gps product that will have voice recognition and bluetooth capability. discuss and conceptualize a user interaction model. predict two (2) problems that may arise in gps products with voice recognition and bluetooth capability. recommend solutions for each of these issues. attention is one of the six cognition processes. when attention is applied to a design, the goal is to make it easier for the end user to quickly locate where he / she should type information on the computer or mobile device screen. compare and contrast how the google search engine and the microsoft bing search engine employ the attention cognition process. provide your opinion as to which search engine better employs the attention cognition process and explain why.
Answers: 3
question
Computers and Technology, 24.06.2019 17:00
Carlos, an algebra teacher, is creating a series of powerpoint presentations to use during class lectures. after writing, formatting, and stylizing the first presentation, he would like to begin writing the next presentation. he plans to insert all-new content, but he wants to have the same formatting and style as in the first one. what would be the most efficient way for carlos to begin creating the new presentation? going under the file tab and opening the first presentation, deleting all content from each page, and adding new content going under the file tab and clicking on new in the left pane, then choosing new from existing going under the design tab and clicking on themes, then selecting the theme that was used for the first template going under the design tab and opening the template that was created for the first presentation
Answers: 2
You know the right answer?
Write a program to simulate a lottery game. (a) Ask the user to pick 4 unique numbers in the range...
Questions
question
Mathematics, 19.01.2020 18:31
question
Physics, 19.01.2020 18:31
question
Mathematics, 19.01.2020 18:31
Questions on the website: 13722360