+ 4
Whatâs wrong with my code?
Trying to solve the BMI calculator project in Python, here is my try. Anyone that can tell me whatâs wrong? h= float(input("Enter your height")) w= float(input("Enter your weight")) bmi= w/(h**2) if bmi < 18.5: print("Underweight") elif bmi >= 18.5 and < 25: print("Normal") elif bmi >= 25 and < 30: print("Overweight"): else: print("Obesity") It says syntax error line 9 if that helps
1 RĂ©ponse
+ 3
In Python you can't say
if a > x and < y
You have to say either
if a > x and a < y
or
if y > a > x