From 3da6c7bdb61b633de7d233a0348ab9d53344c53b Mon Sep 17 00:00:00 2001 From: MartinSkovran Date: Mon, 5 Oct 2026 22:35:58 +0200 Subject: [PATCH] u4_repair_2_1 --- u4/word_count.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/u4/word_count.py b/u4/word_count.py index e135492..539f89d 100644 --- a/u4/word_count.py +++ b/u4/word_count.py @@ -4,8 +4,8 @@ def count_words(sentance: str) -> dict: sent_list = list(sentance) words = defaultdict(int) - delims = [":", "?", "!", "\n", "\t"] - del_chars = ['"', ",", "."] + delims = [":", "?", "!", "\n", "\t", ",", "."] + del_chars = ['"'] forbidden = delims + del_chars + [" ", "'", ""] @@ -25,6 +25,4 @@ def count_words(sentance: str) -> dict: continue words[w.replace("^", "'")] += 1 - return dict(words) - - \ No newline at end of file + return dict(words) \ No newline at end of file