Python - Sort Dictionaries by Size
Given a Dictionary List, perform sort by size of dictionary. Input : test_list = [{4:6, 9:1, 10:2, 2:8}, {4:3, 9:1}, {3:9}, {1:2, 9:3, 7:4}] Output : [{3: 9}, {4: 3, 9: 1}, {1: 2, 9: 3, 7: 4}, {4: 6, 9: 1, 10: 2, 2: 8}] Explanation : 1 < 2 < 3 < 4, sorted by number of keys of dictionary. In