0

BMI calculator, case #s3-5

I have been working in the BMI calculator for two days. I am able to solve case 1&2, however 3-5 are unsolved and locked so I cannot see the feedback on what I am doing wrong. I do not know what case 3-5 are looking for, (due to being locked) Does anyone know how to unlock or alter my code to solve them? My code is: weight = float(input()) height = float(input()) BMI = weight / (height**2) if BMI <= 25: print("Underweight") elif BMI == 25: print("Normal") elif BMI >= 25: print("Obesity")

25th May 2022, 9:46 AM
M Heather Fleming
M Heather Fleming - avatar
4 Respuestas
+ 1
Yes! That was one of my issues. I changed it to this and it worked: elif BMI >=18.5 and BMI <= 25: print("Normal")
25th May 2022, 4:07 PM
M Heather Fleming
M Heather Fleming - avatar
0
What is the task description? Value 25 is covered by first condition bmi<=25 so condition elif bmi==25 never met..
25th May 2022, 2:35 PM
Jayakrishna 🇮🇳
0
Solved it...! √ You can use single thread.. Remaining comes under dublications.. https://www.sololearn.com/discuss/3037302/?ref=app https://www.sololearn.com/discuss/3037298/?ref=app
25th May 2022, 4:19 PM
Jayakrishna 🇮🇳
0
weight = float(input('')) height = float(input('')) bmi = weight / (height ** 2) if bmi < 18.5: print('Underweight') elif bmi >= 18.5 and bmi < 25: print('Normal') elif bmi >= 25 and bmi < 30: print('Overweight') else: print('Obesity')
12th Jun 2022, 3:35 AM
Nícolas Nascimento
Nícolas Nascimento - avatar