Answer to Question #174685 in Python for bhuvanesh

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.


1
Expert's answer
2021-03-27T07:52:09-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS