You will write three functions for percentage change. The checker uses a sale price, a pay rise and a reverse percentage.
The idea. The percentage change is the change divided by the original. A rise of multiplies by . To go backwards, divide by the multiplier.
Your tasks.
percent_change(old, new). Return the percentage change, which is negative for a decrease.after_change(value, percent). Return the value after a change of percent percent (use a negative number for a decrease).original(new, percent). Return the value before the change of percent percent.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…