pro
This commit is contained in:
parent
988f4e7438
commit
bb5edcaeac
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user