From 3b0f7c6e68b3d102d580e882f9b7f7cece1ac6b1 Mon Sep 17 00:00:00 2001 From: MartinSkovran Date: Mon, 5 Oct 2026 22:34:25 +0200 Subject: [PATCH] u4_repair_2_1 --- u4/word_count.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/u4/word_count.py b/u4/word_count.py index 8413c16..e135492 100644 --- a/u4/word_count.py +++ b/u4/word_count.py @@ -15,7 +15,7 @@ def count_words(sentance: str) -> dict: elif(ch in del_chars): sent_list[i] = "" if(ch == "'"): - if((sent_list[max(i-1, 0)] not in forbidden) and (sent_list[min(i+1, len(sent_list))] not in forbidden)): + if((sent_list[max(i-1, 0)] not in forbidden) and (sent_list[min(i+1, len(sent_list)-1)] not in forbidden)): sent_list[i] = '^' else: sent_list[i] = ""