You will build a small cost of living index from what a household bought in the base year.
The idea. Each weight is the base-year spending: quantity base-year price. The index is . The cost of the base-year basket now is the base-year cost .
Your tasks.
weights_from(quantities, base_prices). Return a list of weights.weighted_index(weights, relatives).cost_now(base_cost, index).Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…