- 1
Why is my BMI calculator returning "Underweight" for weight 120 and height 1.7?
The input is supposed to take weight of 120 a d height of 1.7. Since BMI is greater than 30, in is supposed to print Obesity. But it is printing Undrweight. What am I doing wrong?!
4 Antworten
0
First of all: hard to say without seeing what you actually did so far (please edit your question and insert your code)
Moreover: you could maybe print(BMI) to controll whether the calculation is correct or something like this
Looking forward to look at your code and give you better hints
0
#This is my code for the BMI Calculator
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")
elif (BMI >= 30):
print("Obesity")
#May need to fix the indentation
0
I copied your code and it printed Obesity for me…
Inpout formatted like this:
120
1.7
Did you maybe enter the numbers in the wrong order?
0
I am not sure now. IDLE is outputting Underweight.
Maybe I put in the wrong order of numbers.🤔
Thank you so much!😁