diff --git a/u4/word_count.py b/u4/word_count.py index 2e6771e..6da2abf 100644 --- a/u4/word_count.py +++ b/u4/word_count.py @@ -1,6 +1,6 @@ def count_words(sentence): dict = {} - separators = [".", ",", ":", "!", "?", "\n", "\t", "'", " "] + separators = [".", ",", ":", "!", "?", "\n", "\t", "'", " ", '"'] previous_i = 0 for i, chr in enumerate(sentence): @@ -11,9 +11,9 @@ def count_words(sentence): if word in separators or word == "": continue if word in dict: - print(dict) dict[word] = dict[word] + 1 - print(dict) else: dict.update({word : 1}) - return dict \ No newline at end of file + return dict + +print(count_words("""To je heslo: 'HESLO 123'!", zvolala postava zo seriálu Panelák.\nPotom som utiekol.""")) \ No newline at end of file