BMI Formula: Write a Python Program that asks the user for weight and height and then displays weight class based on BMI

BMI Formula: Write a Python Program that asks the user for weight and height and then displays weight class based on BMI

BMI Formula Write a Python Program that asks the user for weight and height and then displays weight class based on BMI

Answer

# define functions
def bmi(weight, height):

   return (weight*703)/(height*height)
# take input from the user
print("BMI calculate")
weight = int(input("Enter weight: "))
height = int(input("Enter height: "))

bmi = bmi(weight,height))
if bmi < '18.5':
   print("underweight")

elif bmi >= '18.5' && bmi < '24.9':
   print("normal")

elif bmi >= '25.0' && bmi < '29.9':
   print("overweight")
elif bmi >= '30.0':
   print("Very overweight")

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts