+ 1

What is the problem ? (Python)thank you

#your code goes here weight = float(input()) height = float(input()) BMI = round(weight/(height**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") else: print("check your input")

30th Apr 2022, 9:05 PM
mobin___2001
mobin___2001 - avatar
2 Respostas
+ 1
don't round up the BMI, it's causing problem when we enter 18.5, the answer should be "NORMAL" But it's giving "Underweight" which is wrong ❌❌❌ i guess the last else identation is wrong, it should be slightly right, 👇👇👇👇👇 https://code.sololearn.com/c0wXyWi3YDOA/?ref=app my code 👇👇👇 weight = float(input()) hight = float(input()) bmi = weight / hight ** 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")
1st May 2022, 1:10 AM
NonStop CODING
NonStop CODING - avatar
+ 1
Thanks
1st May 2022, 7:14 AM
mobin___2001
mobin___2001 - avatar