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

BMI Calc

Everything checked green except test case # 3, which is hidden. Do you see anything I missed ? weight = int(input()) height = float(input()) bmi = weight//height**2 if bmi < 18.5 : print("Underweight") elif 18.5 <= bmi < 25 : print("Normal") elif 25 >= bmi < 30 : print("Overweight") elif 30 <= bmi : print("Obesity")

4th Feb 2021, 1:13 AM
Davon
Davon - avatar
2 Answers
+ 3
bmi = float(input())/float(input())**2 if bmi<18.5:print('Underweight') elif 25>bmi>=18.5:print('Normal') elif 30>bmi>=25:print('OverWeight') elif bmi>=30:print('Obesity')
21st Feb 2021, 4:54 PM
RXRX
RXRX - avatar
+ 3
Hint : You have to use and operator between two ranges Ex if 45 > h and 56 < h: Print("yes") I hope you have understood this. Happy codding!!
4th Feb 2021, 2:26 AM
Aysha
Aysha - avatar