Proyecto imc | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Proyecto imc

Me sale error en el cuarto caso alguien sabe por que edad=int(input()) altura = float(input()) imc = edad/altura**2 if imc>=0 and imc<=18.4: print('Underweight') elif imc>=18.5 and imc<=24.9: print ("Normal") elif imc >= 25 and imc<=29.9: print ('Overweight') elif imc>=30: print("Obesity")

28th Sep 2021, 12:53 AM
alejandro rubio penagos
alejandro rubio penagos - avatar
3 Answers
0
# ¡Prueba esto! edad = float(input()) altura = float(input()) imc = edad / (altura**2) if 0 <= imc < 18.5: print('Underweight') elif 18.5 <= imc < 25: print ("Normal") elif 25 <= imc < 30: print ('Overweight') elif imc >= 30: print("Obesity")
28th Sep 2021, 1:30 AM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Think about what happens if the result is 24.99? 😉
28th Sep 2021, 1:31 AM
Solo
Solo - avatar
0
Pero por que me puedes explicar para no quedar cin la duda ya salieron todos los casos correctos
28th Sep 2021, 1:36 AM
alejandro rubio penagos
alejandro rubio penagos - avatar