- 1
I write this code for BMI calculator. It doesn't work. Why?
hight = float(input()) weight = float(input()) bmi = print (weight / ((hight)**)) if bmi<=19: print ("underweight") elif bmi>=19 and bmi<25: print ("normal") elif bmi>=25 and bmi<30: print ("overweight") elif bmi>30: print ("obesity") print ("thanks")
3 Answers
+ 5
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")
#print ("thanks")
+ 1
Ok sir I get my mistake
0
But, after that, I give this code:
weight = float(int())
hight = float(int())
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")
#print ("Thanks")
What is the problem now?