sentence = input('Enter your sentence here: ')
sentence1 = sentence.split(' ')
set1 = [i for i in sentence1]
list1 = []
for i in set1:
ex = False
for x in list1:
if x == i :
ex = True
break
if not ex :
list1.append(i)
for i in list1:
print(i, ':', set1.count(i))
Comments
Leave a comment