Build an Apply Discount Function - Build an Apply Discount Function

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

try to use isinstance to check your variables type

what is your function returning?

without testing your code, the first problem I see is that your function is ‘printing’ and not ‘returning’. replace all your prints with return