+ 1
I don't know why the second test case said the obesity is wrong,but test 1 said correct for underweight
#your code goes here # BMI CALCULATOR Height_cm = float (input()) Weight_kg = float (input()) BMI = Weight_kg / (Height_cm / 100) ** 2 if BMI < 18.5: print ("Underweight") elif BMI >= 18.5 and BMI < 25: print ("Normal") elif BMI >= 25 and BMI < 30 : print ("Overweight") elif BMI >= 30: print ("Obesity")
9 ответов
+ 1
Thank you
+ 1
Please it's still the same problem after I have changed it
+ 1
Where is your update code..?
Save and share link here..
+ 1
Ok
+ 1
The 1st input is int and the 2nd is float ,to calculat BMI use this formula BMI =the 1st input /the 2nd input **2
+ 1
Thank you very much, I've solved it
0
# BMI CALCULATOR
Weight_kg = float (input())
Height_cm = float (input())
BMI = Weight_kg / (Height_cm / 100) ** 2
if BMI < 18.5:
print ("Underweight")
elif BMI >= 18.5 and BMI < 25:
print ("Normal")
elif BMI >= 25 and BMI < 30 :
print ("Overweight")
elif BMI >= 30:
print ("Obesity")
0
See the farmula again. you may not observed, already told it is
BMI = weight / height**2
0
Está enfocado muy bien