i trying sort both outermost dictionary , "middle" dictionary value of "cal" (highest first) in innermost dictionary. accomplish using ordereddict. given example below, trying accomplish: for foods, order food subtypes highest calorie content (i.e - pizza, pesto should appear first because has higher calories when compared cheese. order foods highest calorie content (i.e - pizza should appear first has subtype more calories other food) i have following data: foods = { "apple": { "red": { "cal": "1", "taste": "4" }, "green": { "cal": "2", "taste": "6" } }, "pizza": { "pesto": { "cal": "200", "taste": "9" }, "cheese": { ...
Comments
Post a Comment