0

I got a bugs , can you help me ?

w = float(input()) h = float(input()) bmi = w/(h**2) 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")

27th Jul 2021, 8:48 AM
M.Syamsul Arifin
M.Syamsul Arifin - avatar
4 odpowiedzi
+ 1
Read the description again and think about using <= and >= whenever it's "more/less than or equal" respectively
27th Jul 2021, 9:07 AM
Slick
Slick - avatar
+ 1
First letter of the output variables should be uppercase Underweight, Normal.....
27th Jul 2021, 11:23 AM
Simba
Simba - avatar
+ 1
Thank you
27th Jul 2021, 11:24 AM
M.Syamsul Arifin
M.Syamsul Arifin - avatar
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.
27th Jul 2021, 8:50 AM
M.Syamsul Arifin
M.Syamsul Arifin - avatar