Loading...
Loading...
Loading...
A CSV report has the header id,price,qty. Using DictReader, print the total order value (price times quantity, summed) with 2 decimals.
Example
Input
3 id,price,qty 1,250.5,2 2,99.99,3
Output
800.97
501.00 + 299.97 = 800.97.
Try the problem first. Open one hint at a time.
csv.DictReader accepts a list of lines, and the first line is the header.
Use float for the price and int for the quantity.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor