1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergey [27]
3 years ago
12

Write a program that generates 1,000 random integers between 0 and 9 and displays the count for each number. (Hint: Use a list o

f ten integers, say counts, to store the counts for the number of 0s, 1s, ..., 9s.)
Computers and Technology
1 answer:
masya89 [10]3 years ago
5 0

Answer:

import random

count0, count1, count2, count3,

count4, count5, count6, count7,

count8, count9, i = [0 for _ in range(11)]

while i < 1000:

   number = random.randint(0,9)

   if number == 0:

       count0 = count0 + 1

   if number == 1:

       count1 = count1 + 1

   if number == 2:

       count2 = count2 + 1

   if number == 3:

       count3 = count3 + 1

   if number == 4:

       count4 = count4 + 1

   if number == 0:

       count5 = count5 + 1

   if number == 6:

       count6 = count6 + 1

   if number == 7:

       count7 = count7 + 1

   if number == 0:

       count8 = count8 + 1

   if number == 9:

       count9 = count9 + 1

   

   i = i+1

print("0's: "+ str(count0) + "\n"+ "1's: "+ str(count1) + "\n"+

"2's: "+ str(count2) + "\n"+ "3's: "+ str(count3) + "\n"+

"4's: "+ str(count4) + "\n"+ "5's: "+ str(count5) + "\n"+

"6's: "+ str(count6) + "\n"+ "7's: "+ str(count7) + "\n"+

"8's: "+ str(count8) + "\n"+ "9's: "+ str(count9) + "\n")

Explanation:

- Initialize variables to hold the count for each number

- Initialize <em>i</em> to control the while loop

- Inside the while loop, check for the numbers and increment the count values when matched.

- Print the result

You might be interested in
What are some good editing software apps for pc?
Anettt [7]

Answer:

If you have the money, buy Adobe Premiere Pro and Adobe After Effects (which is usually used in post-production).

If you need free ones many websites say Filmora, OpenShot, and Lightworks but I've used Filmora before and it's alright.

6 0
3 years ago
In which career field, would the Computing Technology Industry Association's CompTIA A+ certification be useful?
Anna [14]
It's geared towards system administration but would also be useful for devops.
5 0
4 years ago
When setting quotas for disk space, what are the two tools for enabling and configuring quotas? and which of the two are the mor
lora16 [44]
NTFS quotas
File server resource manager.

A system admin has rights to set NTFS quotas if he or she is concerned with some users monopolizing a small amount of disk space. Activating NTFS quotas helps set a storage limit for users using a particular volume. Out of the two, file server resource manager is the most effective and flexible. It is best recommended to use file server resource manager if you need quotas. It comes with file-type filtering and includes folder-level quotas.
8 0
3 years ago
Which of the following activities is not permissible for IT professionals while on the job? Check all of the boxes that apply.
Julli [10]

Answer:

sending coworkers an e-mail joke containing suggestive humor

Explanation:

i think that is the not permissible

7 0
2 years ago
Read 2 more answers
Describe the Pointer with example?​
kodGreya [7K]

Answer:

A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Create a lottery game application. Generate three random numbers (see Appendix D for help in doing so), each between 0 and 9. Al
    14·1 answer
  • Patrick Stafford's article argues that the growth of mobile phone usage "has given developers the ability to great robust and en
    7·1 answer
  • Which of these practices should you follow while creating your résumé?
    14·1 answer
  • The fact that the speed of a vehicle is lower than the prescribed limits shall relieve the driver from the duty to decrease spee
    11·2 answers
  • Two Smallest (20 points). Write a program TwoSmallest.java that takes a set of double command-line arguments and prints the smal
    7·1 answer
  • How do you change the number of rows and columns displayed for an embedded Excel object on a PowerPoint slide?
    8·1 answer
  • If the signal is going through a 2 MHz Bandwidth Channel, what will be the maximum bit rate that can be achieved in this channel
    14·1 answer
  • What does this mean?​ pls help me
    12·1 answer
  • Which design monument beginning with A inspired the chrysler building in New York​
    14·1 answer
  • What ethical concerns might arise from applying new IT to law enforcement?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!