How to sort a Python dictionary by value?
Answers
Answered by
0
Answer:-
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.
Hope it's helps!!
Thanks ✌️✌️
Answered by
0
Answer:
use this method-
import operator
sorted(dict,key = operator.itemgetter(1))
Similar questions
English,
6 months ago
Hindi,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago
Math,
1 year ago
Biology,
1 year ago