Build a Discount Calculator - Build a Discount Calculator

Tell us what’s happening:

I can’t figure out why it doesn’t like my functions output as it matches what the stories have asked for? I have read all of the recent posts with the same issue as me but I must be simple because I still cant figure it out, please help!

Your code so far

def apply_discount(price, discount):
    if not isinstance(price, (int, float)):
        print("The price should be a number")
    elif price <= 0:
        print("The price should be greater than 0")
    elif not isinstance(discount, (int, float)):
        print("The discount should be a number")
    elif discount <0:
        print("The discount should be between 0 and 100")
    elif discount >=101:
        print("The discount should be between 0 and 100")
    else:
        print(price * (100 - discount) / 100)


apply_discount("20", 20)
apply_discount(20, "20")
apply_discount(-1, 20)
apply_discount(20, -1)
apply_discount(100, 20)
apply_discount(200, 50)
apply_discount(50, 0)
apply_discount(1, 100)
apply_discount(74.5, 20.0)

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

What your function returns?

The discount should be a number
The price should be greater than 0
The discount should be between 0 and 100
80.0
100.0
50.0
0.0
59.6

To confirm what your function returns, it can be wrapped with the print function. With additional note, ie.

print('Result:', apply_discount(100, 20))

Per specification result for this case should be 80, so there should be Result: 80 in the console after running the above code.