Python 2 dict_items.sort() in Python 3
- by DaveWeber
I'm porting some code from Python 2 to 3. This is valid code in Python 2 syntax:
def print_sorted_dictionary(dictionary):
items=dictionary.items()
items.sort()
In Python 3, the dict_items have no method 'sort' - how can I make a workaround for this in Python 3?