Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

bmi python

weight = float(input("Enter weight (in kg): "))
height = float(input("Enter height (in m): "))

bmi = weight / (height * height) # formula
value = "" # value of bmi

if bmi < 18.5:
    value = "underweight"
elif 18.5 < bmi < 25:
    value = "normal weight"
elif 25 < bmi < 30:
    value = "overweight"
elif 30 < bmi < 35:
    value = "obese"
elif bmi > 35:
    value = "clinically obese"

print(f"You are {value}.")
 
PREVIOUS NEXT
Tagged: #bmi #python
ADD COMMENT
Topic
Name
1+2 =