← back to unit
Medium
# functions
Calculate the Shop Discount
A shop sometimes runs a discount — but not always! Give discount_percent a default so no discount is applied if it's left out. 🏪
Finish final_price(price, discount_percent=0): return the price after subtracting the discount. The discount amount is price * discount_percent // 100. We'll print the price with no discount, then the price with a 20% discount, on two lines.
💡 need a hint?
func-shop-discount.py🔒 given lines are locked — write your code in between
loading...