Please I have help with this, I was certain my code was right but it fails, and the hint always seems to be something I’ve already done (e.g name a function apply_discount)
def apply_discount(price, discount):
if not isinstance(price, (int, float)):
return “The price should be a number.”
if not isinstance(discount, (int, float)):
return “The discount should be a number.”
if price <= 0:
return “The price should be greater than 0.”
if discount < 0 or discount > 100:
return “The discount should be between 0 and 100.”
return price - (price * discount / 100)
Also sorry but I’m new and wasn’t sure the best way to ask this.