+ 2
BMI CALCULATOR
Help me find my error in my BMI CALCULATOR code This what I wrote: weight=float(input()) height=float(input()) BMI=weight/(height**2) if BMI<18.5: print("Underweight") elif BMI>=18.5 and BMI<20: print("Normal") elif BMI>=20 and BMI<30: print("Overweight") elif BMI>=30: print("Obesity") Advance Thank you!
7 Answers
+ 7
See there's just a small mistake and that's in line 6 and 8 .
There u have to write 25 instead of 20.
weight=float(input())
height=float(input())
BMI=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")
+ 3
I already changed the whole code and the new one worked!
+ 1
Ok nice
+ 1
Thank youâ¤ď¸
+ 1
Sushi
Try this:
#your code goes here
weight = int(input());
height = float(input());
bmi = weight/float(height*height);
if bmi<18.5:
print('Underweight')
elif bmi>=18.5 and bmi<25:
print("Normal")
elif bmi>=25 and bmi<30:
print('Overweight')
else:
print('Obesity')
0
It is working fine what's wrong?
0
there's some errors in that code.