BMI calculator not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

BMI calculator not working

Hello, guys! I am a beginner Python student and I'm stuck with this. It doesn't work. :-((( height = float(input()) weight = 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") Can you help me? Thank you!

2nd Feb 2021, 6:28 PM
Rocío Garrido Añón
Rocío Garrido Añón - avatar
2 Answers
+ 7
Please check the strings in print(): They must be exactly the same as in the task instruction
2nd Feb 2021, 6:33 PM
Lisa
Lisa - avatar
0
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:57 PM
RXRX
RXRX - avatar