Write a Python program to sort (ascending) a dictionary by value.
Topic: Write a Python program to sort (ascending) a dictionary by value.
Solution
d = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} print({k :v for k,v in sorted(d.items(),key = lambda x : x[1])})
List all Python Programs