17 lines
274 B
Python
17 lines
274 B
Python
|
text = [("Я пришел, я ушел, я нашел")]
|
||
|
|
||
|
|
||
|
def word_count(text):
|
||
|
x = text.split()
|
||
|
y = {}
|
||
|
for i in x:
|
||
|
if i in text:
|
||
|
y[i] += 1
|
||
|
else:
|
||
|
y[i] = 1
|
||
|
return word_count
|
||
|
|
||
|
p = word_count
|
||
|
for p in text:
|
||
|
print(p)
|