I have a small script in Python with a dictionary same as follows:
d = {'category_1' : ['a', 'b'], 
'category_2' : ['c', 'd', 'e'],
'category_3' : ['z']}
How can I sort it based on number of values in list? I want it looks like:
d = {'category_3' : ['z'], 
'category_1' : ['a', 'b'], 
'category_2' : ['c', 'd', 'e']}
 
     
    