9 Answers
+ 4
Suppose you get a bmi of 24.99. This case is not covered by the code yet. I would recommend you use < 25 instead of <= 24.9 and so forth
+ 2
Please put your code in a playground script and link it here!
+ 2
What did you input?
imc = weight/ tall**2
As you renamed the variables
Line 5: imc (not IMC)
And if you have <= 25 and >= 25 the number 25 is covered twice
+ 1
Your "else if" should be "elif" in python. Also don't cast z to integer
0
Hi, I did it but it doesn't work
It says "invalid literal for int() with base 10:" what does it mean?
Sorry if I'm a bore
- 1
It says me the same, "in line 1 <module> weight=int(input())
evalue error: invalid literal for int() with base 10:"
I don't know what does it mean
- 1
You want a normal calculator?
- 1
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")
else:
print("Obesity")