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] = ""