I want to sort my dictionary be length of keys (first- keys with the biggest length, in the end - with the smallest)
For example:
dictionary = {"aa" : 1, "aaaaaaa": 2, "aaa" : 3, "a": 4}
as a result after sorting must be:
{"aaaaaaa": 2, "aaa" : 3, "aa" : 1, "a": 4}