If sorted( ) is applied on a dictionary, what does it return ?
Python Dictionaries
3 Likes
Answer
If only sorted() is applied on dictionary then it considers only the keys of the dictionary for sorting and returns a sorted list of the dictionary keys. For example: