0
BMI Calculator Code Project, Python
Can someone please tell me what is wrong with my code? First test case passes, but second case fails as it says my code outputs underweight when it should be obesity. I don’t understand how. 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') else: print('Obesity')
2 Respuestas
+ 4
Input order looks wrong. First weight then height, my sample input was:
Sample Input
85
1.9
+ 1
Thank you, that was it!