파이썬/exercise

2-1/3-1 python BMI calculator

태지쌤 2022. 12. 27. 03:52
반응형
height = float(input("enter your height in m: "))
weight = float(input("enter your weight in kg: "))

bmi = weight / (height * height)
bmi_int = int(bmi)

print("BMI : ", bmi_int)
height = float(input("enter your height in m: "))
weight = float(input("enter your weight in kg: "))

bmi = weight / (height * height)
bmi_int = int(bmi)

if bmi_int < 18.5:
    print('underweight')
elif bmi_int < 25:
    print('normal weight')
elif bmi_int < 30:
    print('overweight')
elif bmi_int < 35:
    print('obese')
else:
    print('clinically obese')
반응형