I have data that has been arranged in the following format
products{} = {'001':['001','Espreso',2.50],
'002':['002', 'Latte',1.50],
'003':['003', 'Orange Juice',1.00],
'004':['003', 'Apple Juice',1.00],
}
I would like to sort the dictionary based on price so that I can get the following output.
products{} = {'003':['003', 'Orange Juice',1.00],
'004':['003', 'Apple Juice',1.00],
'002':['002', 'Latte',1.50],
'001':['001','Espreso',2.50],
}
Being a newbie to python, I cant seem to find a proper guidance to sort this. I have an array as value.
Please guide how to achiece this? Is this even a correct way of assigning array as value to a key.? Is this known as ordered dictionary?