+ 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")
2 odpowiedzi
+ 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")
+ 1
Thanks