0
BMI Calculator error
I'm getting an error but i dont understand where i went wrong. File "/usercode/file0.py", line 7 elif bmi < 25: ^ SyntaxError: invalid syntax #your code goes here weight= float(input ("Enter weight")) height= float(input ("Enter height")) bmi = weight / (height*height) if bmi < 18.5: print("Underweight") elif bmi < 25: print("Normal") elif bmi < 30: print("Overweight") else bmi > 30: print("Obesity")
2 Answers
+ 3
Indentation matters in python
if...:
Stmts..
elif ...:
stmts...
elif...:
stmts..
else:
stmts...
+ 3
Also there is no conditional after the else statement.
if conditional:
if true do this stuff
elif conditional:
if true do this stuff
else:
if none of the above are true do this stuff