briiiii8719 briiiii8719
  • 03-07-2021
  • Computers and Technology
contestada

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

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 03-07-2021

Answer:

The program in Python is as follows:

wordInput = input()

myList = wordInput.split(" ")

for i in myList:

   print(i,myList.count(i))

Explanation:

This gets input for the word

wordInput = input()

This splits the word into a list using space as the delimiter

myList = wordInput.split(" ")

This iterates through the list

for i in myList:

Print each word and its count

   print(i,myList.count(i))

Answer Link

Otras preguntas

What are the tax implications for a public company if it purchases the assets another company? 2. What are the tax implications to public company if it purchase
concert The following measurement​
Hypothesis for “Does social media cause depression?”
Find the solution to the system of equations.
Consider: 222× −322 = 33 6×922 Do you agree or disagree? _____________ Justify your choice:
delaney plans to run at lest 7 miles each week. delaney has a circular route in the neighborhood to run. once around that route is 220 yards if delaney runs th
15. What is the value of p in the equation below? 5√√p-36= √√p
That very next morning Robert and I, sitting behind Hammond and George on their bays, went over to the patch of ground Mitchell’s family tended. Now, the Thomas
який характер у месі​
WILL GIVE BRAINLIEST!! Find the measure of side WU.