What I'm getting and what I need to get pic
text = "the faith that he had had had had an affect on his life"
dictionary = {}
text = text.split()
for word in text:
key = len(word)
if key in dictionary.keys():
dictionary[key] += [word]
else:
dictionary[key] = [word]
return dictionary
For the word in the text, there are repeated words. How do I return the dictionary with no repeated words?