solution.py
Python 3
Reset
import csv import io # In the real system this would be a file; for this trial the CSV is inline. CSV_DATA = """date,product,amount 2026-04-01,Widget,29.99 2026-04-01,Gadget,149.50 2026-04-02,Widget,29.99 2026-04-02,Sprocket,8.75 2026-04-03,Gadget,149.50 2026-04-03,Sprocket,8.75 2026-04-03,Widget,29.99 """ reader = csv.DictReader(io.StringIO(CSV_DATA)) # TODO: collect amounts, then compute and print summary
Run
Ctrl+⏎
AI Review
Console