hnc-eduard/HNC/Excercises/ДЗ 03072023/main.py

13 lines
229 B
Python
Raw Permalink Normal View History

2023-07-03 22:57:22 +02:00
def word_count(text):
import re
a = re.sub("[^А-Яа-я-A-Z-a-z ]", "", text)
b = list(a)
for i in b:
c = b.count(i)
return b
f = 'Я пришел, я ушел, я нашел'
print(word_count(f))