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
Nana76 [90]
3 years ago
10

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. Ex: If the input is: he

y hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1
Computers and Technology
1 answer:
Tpy6a [65]3 years ago
4 0

Answer:

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

Explanation:

This program that we are told to write will be done by using python programming language/ High-level programming language.

The question wants us to write a program in which the output will be as below;

hey 1

hi 2

Mark 1

hi 2

mark 1

Just by imputing hey hi mark hi mark.

Just copy and run the code below.

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

You might be interested in
An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
Nana76 [90]

Answer:

All of the above

Explanation:

An interrupt priority scheme is a system which decides the priority at which various work is done and it perform all of the above mention task so therefore all of the above is the right answer.

5 0
3 years ago
What is application launchers functions​
andrey2020 [161]
An app launcher replaces the stock user interface for organizing the home screen and app icons predominantly in the Android world; however, they are also available for jailbroken iPhones (see iPhone jailbreaking and Cydia). See Launchpad.
5 0
3 years ago
Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should
HACTEHA [7]

Answer:

speed = float(input("Enter the speed: "))

hours = int(input("Enter the hours: "))

distance = 0

for i in range(hours):

   distance += speed * 1

   print("The distance after " + str(i+1) + ". hour(s): " + str(distance))

Explanation:

*The code is in Python.

Ask the user to enter the speed and the hours

Initialize the distance as 0

Create a for loop that iterates hours times. Inside the loop, calculate the cumulative distance traveled at the end of each hour and print it (Note that the distance = speed x hour)

5 0
3 years ago
Using the POP standard for client to server e-mail communication, the e-mail messages remain on the server computer. True False
Gelneren [198K]

Answer:

False

Explanation:

8 0
3 years ago
With the cold winter months fast approaching, Lungi wants to improve the overall effectiveness of operations at his NGO. He want
igor_vitrenko [27]
There would not be enough blankets
5 0
2 years ago
Other questions:
  • Shortcuts can help you complete spreadsheet tasks more efficiently. True False?
    7·2 answers
  • Households pay taxes to the government and receive public services. Which of the following is a public service?
    8·1 answer
  • Engineers and scientists redesign a prototype if it does not work correctly true or false and why
    10·2 answers
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • A network administrator determines who may access network resources by assigning users
    10·1 answer
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • Brain for free 12628397
    14·2 answers
  • Write F id the following is formatting tags, H for heading tags, S for structural tags, and SC if it belongs to a seperator/cont
    14·1 answer
  • Dynamics
    11·1 answer
  • Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printed line, print t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!