Question: Implement function wordcount ( ) that takes as input a text - as string - and prints the frequency of each word in the text.

Implement function wordcount ( ) that takes as input a text - as string - and prints the frequency of each word in the text. You may assume that the has no punctuation and word are separated by blank spaces

>> text = ' all animals are equal but some \

animal are more equal than other '

>> wordCount (text)

all appears 1 time .

animals appears 2 times.

some appears 1 time.

equal appears 2 times.

but appears 1 time.

are appears 2 times.

others appears 1 time.

than appears 1 time

more appears 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!