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 organ is known as the windpipe and the tube takes in air ?
-4a - 7 = 3 - 4a - 7 a) -6 b) no solution c) -8 d) -9
Which algebraic expression can be used to represent HLAF of x increased by 5
bye boy a eliminar esta cuenta cuidense ​
Harvey records the weight, in pounds, of burgers that his family was making for dinner. He displayed his data on the line plot below. c3 How many burgers did H
this is an organism whose genome has been altered by the techniques of genetic engineering so that its DNA contains one or more genes not normally found there
What is the net force in the y-direction? 0 N 25 N 225 N 250 N
hello how is everuone
dose anybody know this?
Which are examples of how Lester Maddox changed his views on race relations? will give brainleist ! Check all that apply. He honored Martin Luther King Jr. He