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 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Communication is the exchange of information. true false
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What can you prevent issues related to downloading content form the internet
Answers: 1
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, 21.11.2019 07:31
question
Mathematics, 21.11.2019 07:31
question
English, 21.11.2019 07:31
question
Mathematics, 21.11.2019 07:31