+ 1
Hi. I want to know why my code is failing. There is 1/5 test that breaks when execute and i really don't know why.
Here My code: peso = int(input()) altura = float(input()) imc = peso / (altura*altura) if imc < 18.5: print ('Underweight') if imc > 18.5 and imc <= 24.9: print ('Normal') if imc > 25.0 and imc <= 29.9: print ('Overweight') if imc > 30.0: print ('Obesity')
2 Answers
+ 8
What happens if imc = 18.5. And why do you not use imc < 25? Why 24.9. What happens if imc = 25?
+ 1
Thank you. I think the problem was the floats between the units.