diff --git a/python/word-count/word_count.py b/python/word-count/word_count.py index 6d198ce..8cbe827 100644 --- a/python/word-count/word_count.py +++ b/python/word-count/word_count.py @@ -1,7 +1,8 @@ def count_words(input_sentence): sentence = input_sentence.lower() - # blocked_characters = [',', '.', ';', ':'] - # sentence = ''.join(item for item in sentence if item.isalnum()) + blocked_characters = [',', '.', ';', ':', '_'] + for character in blocked_characters: + sentence = sentence.replace(character, " ") words = sentence.split() result = {}