- 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")

21st Jun 2021, 8:33 AM
Shahadat Hossain Shaykot
Shahadat Hossain Shaykot - avatar
3 Respostas
+ 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")
21st Jun 2021, 8:47 AM
Simba
Simba - avatar
+ 1
Ok sir I get my mistake
22nd Jun 2021, 10:15 AM
Shahadat Hossain Shaykot
Shahadat Hossain Shaykot - avatar
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?
22nd Jun 2021, 10:11 AM
Shahadat Hossain Shaykot
Shahadat Hossain Shaykot - avatar