def get_word_len_dict(text):
    result_dict = defaultdict(set)
for word in text.split():
    result_dict[str(len(word))].add(word)
return result_dict
Creating a dictionary where the key is an integer and the value is the length of a random sentence