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 examples of templates the Input Mask Wizard offers? Check all that apply.
Vesna [10]
The answer is A B AND D mark me brainliest?
5 0
3 years ago
Read 2 more answers
A technician configures a switch with these commands:SwitchA(config)# interface vlan 1 SwitchA(config-if)# ip address 192.168.1.
yanalaym [24]

Answer:

SVI (Switched Virtual Interface)

Explanation:

For a switch to have an IP address, a switch virtual interface must be configured. This allows the switch to be managed remotely over the network.

5 0
3 years ago
QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
IgorLugansk [536]

Answer:

yes cuz 25x8=200

Explanation:

3 0
3 years ago
Read 2 more answers
Which quality of service (QoS) mechanism provided by the network does real-time transport protocol (RTP) rely on to guarantee a
Radda [10]

Answer:

The real-time transport protocol (RTP) carries the audio and video data for streaming and uses the real-time control Protocol to analyse the quality of service and synchronisation. The RTP uses the user datagram protocol ( UDP) to transmit media data and has a recommended Voice over IP configuration.

Explanation:

RTP is a network protocol used alongside RTCP to transmit video and audio file over IP networks and to synchronise and maintain its quality of service.

8 0
3 years ago
How does the use of imagery create meaning
Contact [7]

Imagery is a feature of written and spoken language and occurs whenever someone has chosen to use language in a non-literal way.

Imagery is a way of describing something symbolically, using words to create a picture in the reader's imagination.

In the Close Reading paper you need to be able to recognise imagery and to consider how successful the imagery is at conveying to you what the writer is trying to express. Imagery frequently conveys more than just meaning. It is used to heighten the effect of language and is often an extension of word-choice. Normally an image will extend to a phrase or a few words but sometimes it will be longer. The simplest form of imagery to recognise is when something or someone is compared to something else, with the purpose of establishing some parallel between the two. Images of this kind frequently concern qualities like beauty, speed, force, power and natural and animal traits.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Remember for a moment a recent trip you have made to the grocery store to pick up a few items. What pieces of data did the Point
    15·1 answer
  • hello my friend is doing a give away at 100 followers would you follow him for a chance to win 2000 vbucks his name is ZoVa_Velo
    15·2 answers
  • Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a
    14·1 answer
  • What are 3 important reasons to reconcile bank and credit card accounts at set dates?
    15·1 answer
  • What does the -pwd switch do? how can you make dsadd bring up a prompt asking for the users password?
    10·1 answer
  • What type of waves in the electromagnetic spectrum has the Search for Extraterrestrial Intelligence (SETI) mostly analyzed in th
    15·1 answer
  • Define the instance method inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for th
    6·1 answer
  • Take two String inputs of the same length and merge these by taking one character from each String (starting with the first ente
    8·2 answers
  • I came here for a answer so why did i get a pep talk
    7·2 answers
  • Which describes the Paradox of Automation?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!