+ 2
I think I'm stuck
Height = float(input()) Weight = float(input()) x = "BMI" x = Weight/Height**2 if x < 18.5 : print("Underweight") elif x >= 18.5 and x < 25 : print("Normal") elif x >= 25 and x < 30 : print("Overweight") elif x > 30 : print("Obesity")
8 Réponses
+ 2
in your first code you have swapped the input: weight should comes before height...
it seems that your last post correct this, but as it is not correctly formatted, it's hard to say if you've introduced a new error ;P
+ 1
The math must be wrong. Have you tested yours with one online to see if you get the same results? If not, do that
+ 1
you already posted that, if anything, put it in the playground and link the code here. I can't run it from here like this
0
Stuck on what? Seems to work fine
0
Only test case 1 works
0
I don't know why
0
I'll try that
- 1
weight = float(input()) height = 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')