You will write three short functions about price relatives: from two prices, back to a price, and between two years that are not the base year.
The idea. Price relative . Going back, price now base price . Between two years, the percentage change is .
Your tasks.
price_relative(base_price, price_now).price_from_relative(base_price, relative). Return the price now.change_between(earlier, later). Return the percentage change from one relative to the other.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…