17 lines
304 B
Python
17 lines
304 B
Python
|
text = [("Я пришел, я ушел, я нашел")]
|
||
|
|
||
|
|
||
|
def word_count(text):
|
||
|
text_dict = dict()
|
||
|
|
||
|
for i in text:
|
||
|
if i in text_dict:
|
||
|
text_dict[i] = text_dict[i] + 1
|
||
|
else:
|
||
|
text_dict[i] = -1
|
||
|
return text_dict
|
||
|
|
||
|
p = word_count
|
||
|
for p in text:
|
||
|
print(p)
|