Users Pricing

forum

home / developersection / forums / sort a python dictionary by value

Sort a Python dictionary by value

Anonymous User 2705 13 May 2015

I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary.

I can sort on the keys, but how can I sort based on the values?


I am a content writter !


1 Answers