Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def frequency(str):
- str = str.split()
- str2 = []
- for i in str:
- if i not in str2:
- str2.append(i)
- for i in range(0, len(str2)):
- c = str2.sort()
- d = str.count(str2[i])
- if d > 0 :
- print(str2[i],'-',d)
- str = input()
- frequency(str)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement