hello can someone point out to me what is wrong in my code i already tested it and it gives the correct output but i cant pass the 3 and 4 which is determining if the price and discount is int or float.
def apply_discount(price, discount):
if not isinstance(price,(int, float)):
return "the price should be a number"
if not isinstance(discount,(int, float)):
return "the discount should be a number"
elif price <= 0:
return "The price should be greater than 0"
elif discount < 0 or discount > 100:
return "The discount should be between 0 and 100"
else:
discount = (discount/100)*price
price = price - discount
return price
print(apply_discount("100", 20))
print(apply_discount(100, "20"))
print(apply_discount(100, 101))
print(apply_discount(0, 101))
print(apply_discount(100, 20))
print(apply_discount(200, 50))
print(apply_discount(50, 0))
print(apply_discount(74.5, 20.0))