Your return statement is indented too far, as it returns after the first word is added to the dictionary. It should be:
for word in list_s:
if word in dct_cnt:
count = dct_cnt[word]
count += 1
dct_cnt.update({word: count})
else:
count = 1
dct_cnt.update({word: count})
return dct_cnt
You should only return once the
for
loop has processed each word in the list.