+ 2
please can someone help me find the errors in this code for a bmi calculator
height=float(input()) weight=int(input()) BMI= weight / height **2 if BMI < 18.5: print('underweight') elif 18.5 <= BMI < 25: print('normal') elif 25 <= BMI < 30: print('overweight') else BMI > 30: print("obesity")
4 Respuestas
+ 3
I hope this can you help
https://code.sololearn.com/c8mPxRZKHZnR/?ref=app
+ 2
Python is case-sensitive. If the question asks for Normal but gets normal, it will be marked wrong.
+ 1
if bmi < 18.5:
print("Underweight")
if bmi >= 18.5 and bmi < 25.0:
print("Normal")
if bmi >= 25.0 and bmi < 30.0:
print("Overweight")
if bmi >= 30.0:
print("Obesity")
Use separate if and statements and link the conditions with the and operator
+ 1
Put the height ** 2 in brackets:
(height ** 2)