+ 1
Whats wrong with my code
I'm trying to do the BMI calculator in Python for beginners and my code isn't working. Where am I going wrong? https://code.sololearn.com/cd33KGZApj6V
3 Answers
+ 2
weight = int(input())
height = float(input())
# create a variable for easy usabilty
bmi = weight/(height*height)
if bmi <= 18.5:
print("Underweight")
# there should bmi on both sides of operators
elif 18.5<=bmi<25:
print("Normal")
elif 25<=bmi<30:
print("Overweight")
elif bmi >30:
print("Obesity")
This should help
+ 1
use declared variable instead of everytime to write
weight/(height*height)
bmi = weight/(height*height)
0
Thank you! That makes so much more sense!