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")

22nd Apr 2022, 1:58 AM
Randy Seah
Randy Seah - avatar
2 Answers
+ 3
Indentation matters in python if...: Stmts.. elif ...: stmts... elif...: stmts.. else: stmts...
22nd Apr 2022, 2:03 AM
Paul K Sadler
Paul K Sadler - avatar
+ 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
22nd Apr 2022, 5:32 AM
William Owens
William Owens - avatar