0 points

Printing dict pairs sorted by key


dashboard

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

Posted by @phi #python

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

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

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