def cal_bmi2(height, weight):
 height = height * 0.01
 bmi = weight / (height * height)
 print("BMI: ", bmi)
 if bmi < 18.5:
  print("마른체형")
 elif 18.5 <= bmi < 25.0:
  print("표준")
 elif 25.0 <= bmi < 30.0:
  print("비만")
 else:
  print("고도비만")


while 1:
 height = input("Height (cm): ")
 weight = input("Weight (kg): ")
 cal_bmi2((height),(weight))


while 1:
 height = input("Height (cm): ")
 weight = input("Weight (kg): ")
 cal_bmi2(float(height),float(weight))


float() 유무 차이좀



파이썬 4일차