BMI calculator:
BMI is a quick and inexpensive way to categorize a person's weight as underweight, normal, overweight, or obese.
BMI formula:
BMI is calculated by dividing weight by height squared:
Metric units:
BMI = weight (kg) / [height (m)]2
US customary units:
BMI = weight (pounds) / [height (in)]2 x 703
Example:
weight=float(input("Enter your weight:"))
height=float(input("Enter your height:"))
bmi=weight/(height**2)
print("BMI:",bmi)
def bmi_feedback(bmi):
if bmi<18.5:
return "You are very underweight"
elif bmi>=18.5 and bmi<=24.9:
return "You have a healthy weight"
elif bmi>=25 and bmi<=29.9:
return "You are overweight"
else:
return "you are obese"
bmi_result=bmi_feedback(bmi)
print("BMI Result:",bmi_result)
Output:
Enter your weight:58
Enter your height:1.67
BMI: 20.796729893506402
BMI Result: You have a healthy weight
SOCIAL SHARE CARD GENERATOR