Cuéntanos qué está pasando:
Hi guys, so sorry for this, i’m stuck in this Build an Apply Discount Function. I already tested every task and it prints what the lab is asking for but, it doesn’t pass the third task
Tu código hasta el momento
def apply_discount(price, discount):
if not isinstance(price, (int,float)):
print('The price should be a number')
elif not isinstance(discount, (int,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:
final_payment = price - (price * discount/100)
print(final_payment)
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Información del Desafío:
Build an Apply Discount Function - Construye una función Apply Discount