python_math_stat/practica/stepik/stepik_tasks/peace_and_war.py
2023-11-22 23:41:21 +03:00

19 lines
401 B
Python

text = input().lower().split()
list = {}
ind = 0
len_t = len(text)
for word in text:
if ind != len_t:
if word in text:
n = text.count(word)
list[word] = (n)
ind+=1
for key, items in list.items():
print (key,items)
# text = input().lower().split()
# d = { i : text.count(i) for i in text }
# for key, value in d.items():
# print(key, value, end='\n')