+ 1
can someone tell me what's wrong with this code
2 ответов
+ 4
Hi Zelda!
Your logic is correct. But you have to avoid additional things in your outputs of your code. Always remember, your program is accepted by Sololearn if your output is the same as expected. And also you have some typos too.
Here it is your working code.
weight = float(input())
height = float(input())
bmi = weight/(height**2)
if bmi <= 18.5:
print('Underweight')
elif 18.5 < bmi < 25:
print('Normal')
elif 25 < bmi < 30:
print('Overweight')
elif bmi > 30:
print('Obesity')
0
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner You can avoid the chained operators by going from the top to the bottom; from 30 to 18.5