Login using Social Account
     Continue with GoogleLogin using your credentials
Building a word frequency finding program The aim of this exercise is to write a program that prints the most frequent word in a statement.
* Instructions *
Finding the frequency of each word the statement.
statement
having any string, eg. "A quick brown fox jumped over the lazy dog".counts
which will hold the frequency of the words.split()
function split the statement into words and store it in a list called words
.for
loop iterate through each word in the list of words. for
loop use the get()
method to see if the word exists in the dictionary if it does, increment its value by one. Else create a key with the word having a value of 0.Printing the most frequent word.
bigcount
and bigword
with a value of None
, which will store the maximum frequency and most frequent word.counts
and find the most frequent word.No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...