wip commit
This commit is contained in:
parent
9bb348ff36
commit
94b33542ef
|
@ -1,11 +1,11 @@
|
|||
def count_words(input_sentence):
|
||||
sentence = input_sentence.lower()
|
||||
sentence = ' '.join(filter(str.isalnum, sentence))
|
||||
# for character in blocked_characters:
|
||||
# sentence = sentence.replace(character, " ")
|
||||
words = sentence.split()
|
||||
result = {}
|
||||
for word in words:
|
||||
counter = 0
|
||||
if word in words:
|
||||
counter += 1
|
||||
result[word] = counter
|
||||
result[word] = words.count(word)
|
||||
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue