+ 1

Whats wrong with my code

I'm trying to do the BMI calculator in Python for beginners and my code isn't working. Where am I going wrong? https://code.sololearn.com/cd33KGZApj6V

21st Mar 2022, 1:39 PM
Amy
3 Réponses
+ 2
weight = int(input()) height = float(input()) # create a variable for easy usabilty bmi = weight/(height*height) if bmi <= 18.5: print("Underweight") # there should bmi on both sides of operators elif 18.5<=bmi<25: print("Normal") elif 25<=bmi<30: print("Overweight") elif bmi >30: print("Obesity") This should help
21st Mar 2022, 1:45 PM
Faisal Issaka
Faisal Issaka - avatar
+ 1
use declared variable instead of everytime to write weight/(height*height) bmi = weight/(height*height)
21st Mar 2022, 3:31 PM
Shadoff
Shadoff - avatar
0
Thank you! That makes so much more sense!
21st Mar 2022, 1:49 PM
Amy