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 is output if the user types in 8
Lady_Fox [76]

Answer: 8

And if you hold shift while typing it, it gives *

7 0
3 years ago
Which of the following is a reason to use storyboarding? (Select all that apply)
fomenos

Answer:

To have all your ideas in one place

To conceptualize design ideas

To present ideas to a client

Explanation:

A storyboard refera to a graphic organizer which consists of images which are displayed in sequence in order to pre-visualise an animation, motion picture, etc.

It is important as it conveys how a story will flow, and also help in conceptualizing design ideas. Based on the options given, the correct options are:

• To have all your ideas in one place

• To conceptualize design ideas

• To present ideas to a client

3 0
3 years ago
Which of the following connects the processor to the chipset and memory on the motherboard? a. Thread b. FSB c. BIOS d. ALU
IRISSAK [1]

Answer:

The correct Answer is (b) FSB

Explanation:

The chipset is the "superglue" that bonds the microprocessor to the rest of the motherboard and so to the rest of the computer. On a computer, it consists of two basic parts -- the Northbridge and the southbridge. All of the numerous modules of the computer communicate with the CPU over the chipset.

The northbridge joins straight to the processor via the front side bus (FSB). A memory controller is situated on the northbridge, which gives the CPU fast access to the memory. The northbridge also attaches to the AGP or PCI Express bus and to the memory himself.

3 0
3 years ago
Which of the following is the largest unit of information?
Mila [183]
What are the choices?

5 0
4 years ago
Read 2 more answers
The best defenses against covert channels include IDS and intrusion prevention system (IPS) and thoroughly watching all aspects
ddd [48]

Answer:

The statement is True

Explanation:

When talking about computer security, we can define covert channels as an attack on a system capable of creating a loophole for information objects transfer between various processes that would normally not allow communication under the computer security policy. Hence, the best defenses system against this kind of attack is via Intrusion Defense System and Intrusion Prevention System and relentlessly "watching all aspects of an IT infrastructure for aberrant or abnormal events of any type."

7 0
3 years ago
Other questions:
  • Add the following 2's complement binary numbers. Also express the answer in decimal. a. 01+ 1011b. 11+ 01010101c. 0101+ 110d. 01
    8·1 answer
  • If you like to spend time outdoors working with plants and animals, you have a(n) _____. a. bodily/kinesthetic learning style b.
    6·2 answers
  • 10 POINTS! Janis is the only person who can respond to customer inquiries in her small travel company. She receives several cust
    14·2 answers
  • What is the difference between primary storage, secondary storage and off-line storage?
    5·1 answer
  • Write the definition of a function named newbie that receives no parameters and returns 1 the first time it is invoked (when it
    7·1 answer
  • Using a single formatting _______ helps to make reading researched information easier; it lets the reader know what to expect.
    7·1 answer
  • What is the job of a router during the process of routing on the Internet?
    10·1 answer
  • Can someone suggest how to manage a group when you are the group leader?​
    10·2 answers
  • A co-worker is called away for a short errand and leave the clinical PC logged onto the Confidential Information System. You nee
    9·1 answer
  • What does playstation network is currently undergoing maintenance?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!