def word_count(text): text = [("Я пришел, я ушел, я нашел")] x = text y = {} for i in x: if i in text: y[i] += 1 else: y[i] = 1 return word_count