Python Programming

sort dict by value python

Question or problem about Python programming: Assume that I have a dict. data = {1:’b’, 2:’a’} And I want to sort data by ‘b’ and ‘a’ so I get the result ‘a’,’b’ How do I do that? Any ideas? How to solve the problem: Solution 1: To get the values use sorted(data.values()) To get the […]

Continue Reading