Tell us what’s happening:
My code works, plugging in different things into the function and most of the requirements are marked as wrong
Your code so far
def apply_discount(price, discount):
if(type(price) != int and type(price) != float):
print("The price should be a number")
elif(type(discount) != int and type(discount) != float):
print("The discount should be a number")
elif(price<=0):
print("The price should be greater than 0")
elif(discount < 0 or discount > 100):
print("The discount should be between 0 and 100")
else:
print(price - price*discount*0.01)
apply_discount("my code isn't working", 67.69)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Challenge Information:
Build an Apply Discount Function - Build an Apply Discount Function