question 186 Files & Directories · medium
Why is the total always zero?
summarize should return how many orders an export holds and their total value. On orders.csv it returns (4, 0): one order too many, and a total of zero. Find and fix every problem.
Function
summarize(path)Filea header line
order_id,total, then one order_id,total line per orderReturns
(number of orders, sum of the totals); orders.csv gives (3, 141.41)Examples
callsummarize('orders.csv')returns(3, 141.41)