0
Why is my code giving error?(BMI calculator from python for beginners project)
height = float(input()) weight = float(input()) bmi = weight / float(height*height) if bmi < 18.5: print("underweight") if bmi >=18.5 and bmi <25: print("normal") if bmi >=25 and bmi <30: print("Overweight") if bmi >=30: print("Obesity")
4 Answers
+ 4
And check the sample input again:
1. Input weight
2. Input height
+ 4
Ngawang Zangphel
Your code works but won't pass the challenge tests because your outputs don't meet the challenge requirements.
All outputs must have a capital letter.
underweight -> Underweight
normal -> Normal
PS: bmi = weight / height**2
cleaner coding
+ 3
Hi!
I tried your code, but got no errors?
For example:
>>> 1.9
>>> 70
normal
+ 1
Lisa
Excellent point!