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
jeff has just upgraded from windows 7 to windows 10 and he is confused. He has started several universal apps but he can't figur
Andre45 [30]

Answer: Find the app you want to close, then go to the moveable panel and click the X.

3 0
3 years ago
Search engine ranking evaluates the variables that search engines use to determine where a URL appears on the list of search res
VARVARA [1.3K]

Answer:

True.

Explanation:

Search engines are evaluated on the basis of the variables which are used by the search engines to determine where the URL appears in the list of the search results.There are certain algorithms are also implemented using these variables like panda algorithm.So we conclude that the answer is True.

3 0
3 years ago
You want to drive traffic to a new landing page for a campaign, and want a web address that's short, easy to remember, trackable
Akimi4 [234]

Hootsuite supports you with vanity URLs.

1. vanity URLs

<u>Explanation:</u>

Since the website webpage is landing on campaign, heavy network traffic is expected. Better to have multiple URL methods but it will not solve the purpose of heavy of network access of webpage or web site. Better to use vanity URLS methods to use heavy network traffic.

Vanity URLS means is customizable redirecting or rerouting by branding links or customized URL link. These type of vanity URLS by choosing hosting service and customize link been created. So end user can use link.

6 0
3 years ago
Answer all of the questions,
Phantasy [73]

Answer:

sry but I don't know the answer

5 0
2 years ago
The prediction that the number of transistors on a chip would double about every two years is known as ________. Metcalfe's law
MaRussiya [10]

Answer:

Moore's law

Explanation:

The Moore’s law which was named after the pioneer, Gordon Moore, predicted that the number of transistors on a chip would double about every two years. This law is one of the reasons why computers became so powerful. These transistors and chips are used to make mathematical calculations and in 1965, Gordon made an observation and forecasted that the number of transistors that can be placed in any ICs doubles approximately every two years. Moore was so convinced about this prediction that he went on to co-found the biggest chips processor; INTEL. This trend has been accurate since then but has started to slow down from 2013.

5 0
3 years ago
Other questions:
  • Assume you have just started a new job, have a car loan, and have a student loan. You have just received a cash gift of $1,000 f
    14·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Your help will help me understand my answers by comparing to yours. Your kind contribution is very much appreciated.
    6·1 answer
  • Making the data impossible to recover even by applying physical forensics methods is known as __________ of media.
    13·1 answer
  • You are tasked with leading a project to build a custom software testing tool for client. You have been provided with a set of p
    7·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • What is a task that is not associated with loading existing data into a new ERP system.
    11·2 answers
  • An eReader has a 956-pixel x 1290-pixel grayscale display with each pixel able to display 32 shades of gray. What is the KiB siz
    9·1 answer
  • Why are default parameters useful? *This is JavaScript*
    7·1 answer
  • You would like to see only the last 15 lines of /home/user/log file on your linux machine. Which command line interface (cli) co
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!