'food'), never beverages. Write bill(orders) where each order is (hour, category, amount): total the payable amount, applying the window discount to qualifying lines, 2-decimal rounded at the end.bill([(16, 'food', 400), (16, 'beverage', 200), (20, 'food', 300)])
780.0
400 → 280 in the window; the rest full price.
A per-line multiplier expression works in a comprehension.
Round the sum once.