+ 3

BMI Python

I need help with this one. This is my attempt at it #your code goes here weight = int(input()) height = float(input()) bmi = float(weight / (height)**2) if bmi < 18.5: print("Underweight") elif bmi >= 18.5: if bmi < 25.0: print("Normal") elif bmi >= 25.5: if bmi < 30.0: print("Overweight") elif bmi >= 30.0: print("Obesity") Everything is fine but when the number should print Obesity, it prints No output

7th May 2021, 7:12 AM
Denislav Kitov
Denislav Kitov - avatar
5 Respostas
+ 4
Hi! hint: you do not execute the code section that follows the line print("Normal"), because all the bmi values that fall under the condition >= 18 remain there, but there are no output instructions for them (for <30, and for > 30). think about how to fix it yourself
7th May 2021, 7:31 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 3
Please use search function in Q&A first and you find the problem.
7th May 2021, 7:24 AM
JaScript
JaScript - avatar
+ 3
I found it thanks to you! Thanks
7th May 2021, 7:34 AM
Denislav Kitov
Denislav Kitov - avatar
0
I found the problem, but I want to find where is the miatake I made
7th May 2021, 7:29 AM
Denislav Kitov
Denislav Kitov - avatar
0
Not just the answer
7th May 2021, 7:29 AM
Denislav Kitov
Denislav Kitov - avatar