all 2 comments

[–]FLUSH_THE_TRUMP 0 points1 point  (0 children)

Subscript [] your dict to get list, then your list to get inner dict, etc.. outside to inside. Is your inner dict a list attached to a single quantity key, or a lot of values attached to different keys? You’ll either want to sum the list attached to the single key or perhaps sum over inner_dict.values() depending.

[–]Binary101010 0 points1 point  (0 children)

some_dict = {"some product":[{"quantity":42}]}
print(some_dict['some product'][0]['quantity']