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
crimeas [40]
3 years ago
12

Take a list of numbers that range in value from 0 to 9 and output how many occurrences of each number exist.

Computers and Technology
1 answer:
mel-nik [20]3 years ago
4 0

Answer:

The program in Python is as follows:

def count_occur(myList):

   freq = {}

   for item in myList:

       if item in freq:

           freq[item] += 1

       else:

           freq[item] = 1

       

   for item in freq:

       print(item," ",freq[item])

Explanation:

This gets the list from the main

def count_occur(myList):

This initializes an empty dictionary

   freq = {}

This iterates through the list and count the occurrence of each item

<em>    for item in myList:</em>

<em>        if item in freq:</em>

<em>            freq[item] += 1</em>

<em>        else:</em>

<em>            freq[item] = 1</em>

This iterates through the dictionary

   for item in freq:

This prints each dictionary item and the frequency separated by -

       print(item," ",freq[item])

You might be interested in
When inserting a fly in animation what is the first step in the process?
marishachu [46]

Answer:

The answer: select the element you wish to animate.

Explanation:

4 0
3 years ago
Jessica wants to purchase a new hard drive. She wants a drive that has fast access because she will use it to edit videos on her
professor190 [17]

Answer:

7200 RPM magnetic HDD

Explanation:

This gives her all the benefits of the above mentioned.

6 0
3 years ago
Why is it important to register your software when you install it
Serjik [45]

the normal reasons program creators deliver to enroll your program – to get tech bolster, news, upgrades, offers, bug fixes, and so on. It too ensures your venture since it gives you changeless get to to your enlisted serial number in case something ever happens to your computer or computer program.

6 0
2 years ago
What is powerpoint in a presentation?
Hitman42 [59]
Powerpoint is slides to your subject, whatever your sub is you can go to google slides and make you powerpoint there. you might have make a email account im not sure.

hope this helped!
4 0
3 years ago
Read 2 more answers
Consider the following code: x=random.randint (1, 100) The randint is a ____.​
Mrrafil [7]
Random integer, in this case betweeen 1 and 100
5 0
3 years ago
Other questions:
  • Annie is a nutritionist. She is conducting seminars about following a healthy diet in various offices. Annie adds a picture of f
    14·2 answers
  • IF ACCURATE = BRAINLY (if u answer rubbish randomness= reported AND if you got questions dont ask in answer slot= reported)
    13·1 answer
  • . One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is t
    11·1 answer
  • What development in operating systems happened between the years 1990 and 2000?
    15·1 answer
  • Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
    13·1 answer
  • Which is the oldest of the following sports?
    6·2 answers
  • Which of the following is true for an API? I. Allows different devices to connect with each other II. Allows for Interactivity b
    15·1 answer
  • In Java:
    15·1 answer
  • 3.5 lesson practice quiz Edhesive
    7·2 answers
  • Addition substraction and multiplication are examples of the set of _____ provided by the int data type
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!