cant figure out BMI calculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

cant figure out BMI calculator

this is the code i have made weight= int(input()) height= int(input()) BMI=weight/(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") elif BMI>30: print("Obesity")

11th May 2022, 3:01 PM
Aj Day
Aj Day - avatar
3 Answers
+ 1
Please read the task description carefully: It asks us to get height as float
11th May 2022, 3:17 PM
Lisa
Lisa - avatar
+ 1
Aj Day , all your conditional checks after the first "if", except the last one are wrong. Swap everything => BMI >= 18.5 and BMI < 25, BMI >= 25 and BMI < 30.
11th May 2022, 3:42 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
Also you are checking for "not between " , instead of "between" by your elif conditions... think again.
11th May 2022, 3:43 PM
Jayakrishna 🇮🇳