Apply 5% discount
Input
apply_discount(120)
Output
114.0
120 >= 100 so 5% off: 120 * 0.95 = 114.0
Full lesson preview
Apply tiered discounts to a purchase total and return the final amount rounded to two decimals.
Problem statement
Task
Examples
Input
apply_discount(120)
Output
114.0
120 >= 100 so 5% off: 120 * 0.95 = 114.0
Input format
Output format
Constraints
Samples
Input
apply_discount(250)
Output
225.0
250 >= 200 -> 10% discount -> 225.0