extend the word-count exercise
This commit is contained in:
parent
10153c268e
commit
40fc4a37a2
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in New Issue