Printing dict pairs sorted by key


PHOTO EMBED

Tue Jul 21 2020 19:59:28 GMT+0000 (UTC)

Saved by @phi #python

for key in sorted(my_dict, key=my_dict.get):

    print('{} : {}'.format(key, my_dict[key]))
content_copyCOPY

http://localhost:8888/notebooks/Desktop/for Jupyter/Lesson3.ipynb