0

Where is mistake? About BMi

#Simple calculator BMI (python) #Underweight < 18.5 #Nornal 18.5 - 24.9 #Overweight 25 - 29.9 #Obesity >30 w = float(input()); h = float(input()); imt = w / (h*h); if (imt <= 18.5): print("Underweight"); elif ((imt <= 24.9) and (imt > 18.5)): print("Normal"); elif ((imt <= 29.9) and (imt >= 25)): print("Overweight"); elif(imt >= 30): print("Obesity");

25th Apr 2021, 11:05 AM
Alex Rott
Alex Rott - avatar
2 Antworten
+ 1
...i think you mostly need age to calculate BMI. and not width and height.
25th Apr 2021, 11:24 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
I find mistake. w = float(input()); h = float(input()); imt = w / (h**2); if (imt < 18.5): print("Underweight"); elif(imt >=18.5) and (imt < 25): print("Normal"); elif(imt >= 25 ) and (imt < 30): print("Overweight"); elif(imt >=30): print("Obesity");
25th Apr 2021, 11:31 AM
Alex Rott
Alex Rott - avatar