Question #174685

Given a sentence S, write a program to print the frequency of each word in S. The output order should correspond with the word's input order of appearance.


Expert's answer

s = "Hello World"
unique = []
for c in s:
    if c not in unique:
        unique.append(c)
        print("{} count = {}".format(c, s.count(c)))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS