태지쌤

로봇 & 코딩교육 No.1 크리에이터

파이썬/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')
반응형

'파이썬 > exercise' 카테고리의 다른 글

3-2 python Pizza calculator  (0) 2022.12.27
2-3 python tip calculator  (0) 2022.12.27
2-2 python 남은 삶 계산  (0) 2022.12.27
1-2 python variables  (0) 2022.12.27
1-1 Python Print/input Function  (0) 2022.11.30