+ 1

Python imc

Hi, i cant pass this exercise although my code works on another IDE. w=85 h=1.9 IMC = w/(h**2) if IMC<18.5: print ("Underweight") elif IMC>= 18.5 and IMC<=24.9: print ("Normal") elif IMC>= 25.0 and IMC<=29.9: print ("Overweight") else: print ("Obesity")

8th May 2021, 8:10 PM
Juan Manuel Mora
Juan Manuel Mora - avatar
2 ответов
0
w and h should be declared as inputs: w = int(input()) h = int(input()) Btw in those elif statements, you can skip first condition in both of them
8th May 2021, 8:13 PM
Michal Doruch
0
Thanks !!!!
8th May 2021, 8:22 PM
Juan Manuel Mora
Juan Manuel Mora - avatar