+ 3
What is wrong with my code?
Calculadora imc
6 ответов
+ 2
I think you need to round the IMC, just add the following after 3th line:
>> imc = round(imc, 1)
This is because your if statement is with only one decimal to evaluate.
I hope this resolve your question.
+ 2
Thank you, now, I trying on this way
0
peso = float(input())
altura = float(input())
imc = (peso/(altura**2))
if imc < 18.5:
print("Underweight")
elif 18.5 <= imc <= 24.9:
print("Normal")
elif 25 <= imc <= 29.9:
print("Overweight")
elif imc > 30:
print("Obesity")
0
elif imc >= 30:
print('Obesity')