how to sort words as like dictionary in python code example Example: sort dictionary by key sortedDictionary = sorted(mydictionary.keys())