Loading…
Generate a sales report from the data below.
sales_data = [
{"product": "Laptop", "category": "Electronics", "price": 1000, "qty": 5},
{"product": "Phone", "category": "Electronics", "price": 500, "qty": 10},
{"product": "Desk", "category": "Furniture", "price": 300, "qty": 8},
{"product": "Chair", "category": "Furniture", "price": 150, "qty": 12}
]
Calculate and print total revenue per category.
Output format:
Electronics: 10000
Furniture: 4200
Revenue = price × qty
Downloading Python… (one-time, ~10 MB)
This runs entirely in your browser and is cached for next time.