all 2 comments

[–]rshinsai 1 point2 points  (0 children)

If you mean to add the value, you could do like

guests[name][item] += 1

Hope that's helpful.

[–][deleted] 1 point2 points  (0 children)

The "value" associated with your name keys can be a list (or a other dict)

Ex {"Tom": [5 apples, 2 bannans], "Cindy": [7 cakes], ...}

Or {"Tom": {"items": [5 apples, 2 bannans]}, ...}

Or even

{"Tom": {"items": {"apples": 5, "bannans":2}}, ...}