Skip to content

Functions · routine

Apply a discount

Write discounted(price, percent) that returns the price after taking percent percent off, rounded to 2 decimals.

discounted(80, 25) is 60.0.

Run adds print(discounted(80, 25)) after your code, to try it.

Stuck on the idea rather than the code? The Functions lesson walks through it.