+ 1
What did I do wrong here please? Iām getting the right output but itās still failing the tests
weight = int(input()) height = float(input()) BMI = weight/height**2 if BMI < 18.5: print("underweight") elif 18.5 <= BMI < 25: print("normal") elif 25 <= BMI < 30: print("overweight") else: print("obesity")
6 Answers
+ 8
Use
BMI = weight / (height/100)**2
Correct program is šš
weight = int(input())
height = float(input())
BMI = weight/(height/100)**2
if BMI < 18.5:
print("underweight")
elif 18.5 <= BMI < 25:
print("normal")
elif 25 <= BMI < 30:
print("overweight")
else:
print("obesity")
I hope this solve your problem.
+ 1
Hope this helps
weight = int(input())
height= float(input())
bmi = weight/float(height*height)
if bmi < 18.5:
print("Underweight")
if bmi >= 18.5 and bmi < 25:
print("Normal")
if bmi >= 25 and bmi < 30:
print ("Overweight")
if bmi >= 30:
print("Obesity")
+ 1
It worked! NEZ
Thank you
+ 1
Romie it worked too
+ 1
Abdulmalik Dahiru Kona good š
0
Abdulmalik Dahiru Kona
w = float(input())
h = float(input())
bmi = w/h**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")
#You have to output in the correct cases