Tell us what’s happening:
(50, 0) do not pass my conditionals are all correct
Your code so far
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"
if price and discount:
discount = (price*discount)/100
final_price = price - discount
return final_price
# print(apply_discount(50, 0))
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Challenge Information:
Build an Apply Discount Function - Build a Discount Calculator