Tell us what’s happening:
My 4th line for checking if discount is a int or float is not working. I did the same thing for price and it worked. Does anyone know why?
Your code so far
def apply_discount(price, discount):
if price != int or float:
return 'The price should be a number'
if discount != int or 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 price should be greater than 0'
return price - (price % discount)
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Build a Discount Calculator - Build a Discount Calculator