How do I aggregate 5 random samples of a dict?
How do I aggregate 5 random samples of a dict? Question: I’m trying to sample 5 items from a dict then aggregate them by sum. In this case by building a sum of all 5 prices. How do I do that? import random mydict = { 1: {"name":"item1","price": 16}, 2: {"name":"item2","price": 14}, 3: {"name":"item3","price": 16}, …