Fix indentation for count_words dictionary assignment
This commit is contained in:
parent
58c2991113
commit
7d30399dbd
@ -1,8 +1,9 @@
|
|||||||
def count_words(phrase):
|
def count_words(phrase):
|
||||||
slovnik1 = []
|
slovnik1 = {}
|
||||||
slova = phrase.lower().split()
|
slova = phrase.lower().split()
|
||||||
for gns in slova:
|
for gns in slova:
|
||||||
cisteslovo = gns.strip(".,!:;?'\"")
|
cisteslovo = gns.strip(".,!:;?'\"")
|
||||||
if cisteslovo:
|
if cisteslovo:
|
||||||
slovnik1.append(cisteslovo)
|
slovnik1[cisteslovo] = slovnik1.get(cisteslovo, 0) + 1
|
||||||
|
|
||||||
return slovnik1
|
return slovnik1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user