0
What is this code need to solve "BMI calculator problem"? Test case#1 and #2 are green but other test cases are red.
weight = int(input()) height = float(input()) BMI = (weight / height**2) if BMI < 18.5: print('Under weight') if 18.5 <= BMI < 25: print('Normal weight') if 25 <= BMI < 30: print('Heavy Weight') if BMI >30: print('Obesity')
6 ответов
+ 6
your output strings are incorrect...
test expect exactly what's stated in description:
Underweight
Normal
Overweight
Obesity
+ 3
Myo Min Htet Aung only your last string is correct:
Normal should not be followed by weight, and 2 others must not have space before weight (and be all lowercase except first char uppercase -- word capitalization)
+ 2
Also should be Overweight, not Heavy Weight
+ 1
visph Thanks,Sir! I get it😁😁
0
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
Sample Output
Normal
0
visph Sir..Can you follow me back? Pls