Answer:
def count_words(txt):
lst = txt.split(",")
var = {}
for i in lst:
if i in var:
var[i]+= 1
else:
var[i] = 1
return var
print(word_count("Rock ties with Rock"))
Step-by-step explanation:
This one worked for me, hopefully it's what you were asking.