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.
s = "Hello World"
unique = []
for c in s:
if c not in unique:
unique.append(c)
print("{} count = {}".format(c, s.count(c)))
Comments
Leave a comment