Tell us what’s happening:
“When apply_discount is called with a price (first argument) that is not a number (int or float) it should return The price should be a number.”
I don’t understand why this doesn’t work, type or isinstance isn’t working. pls help
Your code so far
def apply_discount(price,discount):
if not (type(price, int) or type(price, float)):
return('The price should be a number')
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3.1 Safari/605.1.15
Challenge Information:
Build an Apply Discount Function - Build an Apply Discount Function