0
what 's wrong w this code?
weight=input() height=input() bmi = float(weight) / float(height)**2 if bmi < 18.5: result ="Underweight" if bmi >= 18.5: elif bmi < 25: result= "Normal" elif bmi >= 25: elif bmi < 30: result ="Overweight" elif bmi > 30: result= "Obesity" print(result)
5 Respostas
+ 3
if bmi >= 25:
+ 2
you cant put two elif inside each other
+ 1
The identiation
0
#how about the below?
#your code goes here
weight=input()
height=input()
bmi = float(weight) / float(height)**2
if bmi < 18.5:
result ="Underweight"
if bmi >= 18.5:
if bmi < 25:
result= "Normal"
elif bmi >= 25:
if bmi < 30:
result ="Overweight"
if bmi > 30:
result= "Obesity"
print(result)
0
indentation of which line?