+ 1
BMI calculator
while input == 'metric': height = float(()) weight = int(()) bmi = weight/(height*height) if bmi <18.5: print('Underweight') elif bmi >=18.5 and <25: print('Normal') elif bmi >=25 and <30: print('Normal') else: print('Obesity') What is correct code for BMI calculation excercise
4 Answers
+ 1
#your code goes here
weight=int(input())
height=float(input())
BMI = weight/(height**2)
if BMI <= 18.5:
print("Underweight")
elif BMI <= 25:
print("Normal")
elif BMI <=30:
print("Overweight")
else :
print("Obesity")
+ 1
It worked.. i misunderstood the problem.. for normal bmi score is >=18 and <25..
Thank you!
0
#your code goes here
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')
Copy and paste my answer
If it is right vote me
0
#your code goes here
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')
Copy and paste my answer
If it is right please vote for me