0

Wat am i to do to remove d error at line six (25:)

Tracking your BMI is a useful way of checking if you’re maintaining a healthy weight. It’s calculated using a person's weight and height, using this formula: weight / height² The resulting number indicates one of the following categories: Underweight = less than 18.5 Normal = more or equal to 18.5 and less than 25 Overweight = more or equal to 25 and less than 30 Obesity = 30 or more Let’s make finding out your BMI quicker and easier, by creating a program that takes a person's weight and height as input and outputs the corresponding BMI category. Sample Input 85 1.9 x = float(input()) y = float(input()) weight = x height = y BMI = x/y**2 if BMI < 18.5: print("underweight") elif BMI >= 18.5 and BMI < 25: print("Normal") elif BMI >= 25 and BMI < 30: print("overweight") elif BMI >= 30: print("obesity") Wat d correction on this code so i can get my answer

14th Apr 2022, 10:35 PM
Joseph Oyelami
3 Respostas
+ 1
It is an indentation error Write in this way weight=x height=y BMI=x/y if BMI < 18.5: print("underweight") elif BMI => 18.5 and < 25: print("Normal") elif BMI => 25 and < 30: print("overweight") elif BMI => 30 : print("obesity")
15th Apr 2022, 4:03 AM
UNKNOWN
0
Don't you have to write the whole line? elif BMI => 18.5 and BMI < 25.0:
15th Apr 2022, 2:18 AM
Ausgrindtube
Ausgrindtube - avatar
15th Apr 2022, 4:08 AM
UNKNOWN