Tell us what’s happening:
I keep getting an error for tests 9 and 10.
I can’t figure out what’s wrong with this code. Please help.
Your code so far
def apply_discount(price, discount):
if isinstance(price, int) or isinstance(price, float):
if isinstance(discount, int) or isinstance(discount, float):
if price > 0:
if (0 < discount < 100):
final_price = price * (1 - discount/100)
else:
return("The discount should be between 0 and 100")
else:
return("The price should be greater than 0")
else:
return("The discount should be a number")
else:
return("The price should be a number")
return(final_price)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0
Challenge Information:
Build a Discount Calculator - Build a Discount Calculator