Takings in One Currency

Data with PythonEasy+10 XP+10

Takings in One Currency

A small chain has shops in different countries. Each shop reports its takings in its own currency. The takings arrive as a grid: one row per day, one column per shop.

rates[s] is how many pounds one unit of shop s's currency is worth. It applies to that shop's takings on every day.

Task: write daily_takings(sales, rates). Convert every value to pounds, then return the chain's total in pounds for each day, as a list in day order. Round each total to 2 decimal places.

Examples

sales = [[100, 200, 50], [120, 180, 60]]
rates = [1.0, 0.85, 0.5]
returns [295.0, 303.0]
sales = [[1000, 30], [800, 45], [0, 10]]
rates = [0.006, 1.0]
returns [36.0, 49.8, 10.0]

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run