Westonci.ca makes finding answers easy, with a community of experts ready to provide you with the information you seek. Explore in-depth answers to your questions from a knowledgeable community of experts across different fields. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

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

Sagot :

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))

We appreciate your time on our site. Don't hesitate to return whenever you have more questions or need further clarification. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Get the answers you need at Westonci.ca. Stay informed with our latest expert advice.