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
Aleks04 [339]
2 years ago
12

Write a python program which prints the frequency of the numbers that were

Computers and Technology
1 answer:
REY [17]2 years ago
3 0

Answer:

The program is as follows:

my_list = []

inp = input()

while inp.lower() != "stop":

   my_list.append(int(inp))

   inp = input()

Dict_freq = {}

for i in my_list:

   if (i in Dict_freq):

       Dict_freq[i]+= 1

   else:

       Dict_freq[i] = 1

for key, value in Dict_freq.items():

   print (key,"-",value,"times")

Explanation:

This initializes a list of elements

my_list = []

This gets input for the first element

inp = input()

The following iteration is repeated until user inputs stop --- assume all user inputs are valid

while inp.lower() != "stop":

This appends the input to the list

   my_list.append(int(inp))

This gets another input from the user

   inp = input()

This creates an empty dictionary

Dict_freq = {}

This iterates through the list

for i in my_list:

This adds each element and the frequency to the list

<em>    if (i in Dict_freq): </em>

<em>        Dict_freq[i]+= 1 </em>

<em>    else: </em>

<em>        Dict_freq[i] = 1 </em>

Iterate through the dictionary

for key, value in Dict_freq.items():

Print the dictionary elements and the frequency

   print (key,"-",value,"times")

You might be interested in
How do online note-taking tools support students’ academic goals? Check all that apply.
MakcuM [25]

Answer:

all but 3

Explanation:

3 is strange and I need points sorry

5 0
3 years ago
Read 2 more answers
Which access object(s may be used when creating a lookup field to select valu?
BabaBlast [244]
What the heck is your username?
8 0
3 years ago
Select four programs that make up system software.Select four programs that make up system software.
Alenkasestr [34]

Operating system

Boot code

Device drivers

Utilities

5 0
2 years ago
________is a Windows software program with powerful accessibility solution that reads information on your screen using synthesiz
inn [45]

Answer:

The correct answer to the following question will be "JAWS".

Explanation:

  • JAWS is a strong accessibility tool, which uses synthesized speech to look for information on your monitor and provides several helpful commands to make it much easier using applications, edit documentation and read pages of the web.
  • It's a Microsoft Windows screen reader tool that helps visually and blind impaired people to decode the screen either via a message-to-speech interpretation or with a castable sign language display.
  • JAWS is manufactured by Freedom Scientific Blind and Group of Low Vision.

Therefore, JAWS is the right answer.

4 0
3 years ago
A file name extension provides what information about a file?
ASHA 777 [7]
In a file extension, it tells what type of file it is and tells what compiler to run the code.
8 0
2 years ago
Read 2 more answers
Other questions:
  • Which of these is an on-site metric for social media marketing?
    13·1 answer
  • Rebecca received the following e-mail from her boss: I NEED ALL EMPLOYEES TO WORK LATE ON SATURDAY. NO EXCEPTIONS! What is the m
    13·2 answers
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • Subscribe to epic beast brothers thank you
    7·1 answer
  • Help easy 50 points!!!!<br> How do i make someone be the brianliest? No crown thing is appering!!!!
    10·2 answers
  • What type of web provides a framework that allows data to be shared and reuse to deliver
    9·1 answer
  • Write a program, called compute_stats.c, which opens a data file, called numbers.txt, which contains of a list of positive integ
    10·1 answer
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
  • Write a Java program that will be able to generate the sample table below.
    5·1 answer
  • Which web-authoring software enables users to create sophisticated web pages without knowing any html code?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!