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")
4 Antworten
+ 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")
0
What is the task description?
Value 25 is covered by first condition bmi<=25 so condition elif bmi==25 never met..
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
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')