« first day (1535 days earlier)      last day (2043 days later) » 

11:43
This is about as far as I've been able to get, but I'm not sure how to increase the count, or add the price to the previous sum of prices.

grouped = {}

for product in fruits:
name = product['product']
price = product['price']

if name not in grouped:
grouped[name] = {name: 1, 'price':price}
else:
grouped[name] = {name: +=1, 'price': price}
1 message moved from Python
 
10 hours later…
21:45
Speaking of down-voting, I would appreciate help with down-voting this answer: stackoverflow.com/a/51310886/208880
1 message moved from Python

« first day (1535 days earlier)      last day (2043 days later) »