python dict print sorted by name code example Example: sort dictionary by key sortedDictionary = sorted(mydictionary.keys())