Cuéntanos qué está pasando:
i dont understand why my code no pass this detection if is a bool,string print the text and works
Tu código hasta ahora
def apply_discount(price,discount):
if not isinstance(price,(float,int)) or isinstance(price, bool):
print("The price should be a number")
return
elif not isinstance(discount,(float,int)) or isinstance(discount, bool):
print("The discount should be a number")
return
elif price <= 0:
print("The price should be a greater than 0")
return
elif discount <= 0 or discount > 100:
print("The discount should be between 0 and 100")
return
mount_discount = price * discount / 100
total = price - mount_discount
print(total,"y",mount_discount)
apply_discount(True,101)
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36
Información del desafío:
Crear una función para aplicar descuentos - Construye una función Apply Discount
Enlace de GitHub: i18n-curriculum/curriculum/challenges/espanol/blocks/lab-discount-calculator/695774002591bbc5f8cf3e53.md at main · freeCodeCamp/i18n-curriculum · GitHub