Tell us what’s happening:
The code seems to be working as intended when i use apply_discount, but the tests 7-11 are not passing.
I’m not really sure what else there is to do at this point.
Your code so far
def apply_discount(price, discount):
if not (isinstance(price, int) or isinstance(price, float)):
return 'The price should be a number'
if not (isinstance(discount, int) or isinstance(discount, 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'
final_price = price - (discount/100 * price)
print(final_price)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Challenge Information:
Build a Discount Calculator - Build a Discount Calculator