This commit is contained in:
Vadym Afanasiev 2026-10-08 12:18:57 +00:00
parent 988f4e7438
commit bb5edcaeac

View File

@ -4,7 +4,7 @@ def count_words(sentence: str) -> dict[str, int]:
sentence = sentence.lower()
for char in sentence:
if not char.isanum() and char not in ("'", " "):
if not char.isalnum() and char not in ("'", " "):
sentence = sentence.replace(char, " ")
words = sentence.split()