We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b78c69 commit 602f94bCopy full SHA for 602f94b
strings/word_occurrence.py
@@ -1,4 +1,5 @@
1
# Created by sarathkaul on 17/11/19
2
+# Modified by Arkadip Bhattacharya(@darkmatter18) on 20/04/2020
3
from collections import defaultdict
4
5
@@ -15,6 +16,7 @@ def word_occurence(sentence: str) -> dict:
15
16
# Creating a dictionary containing count of each word
17
for word in sentence.split(" "):
18
occurrence[word] += 1
19
+ if '' in occurrence.keys(): occurrence.pop('')
20
return occurrence
21
22
0 commit comments