練習2 計算身體質量指數(Body Mass Index,BMI)
12345678910111213141516171819202122232425262728
# 練習2 計算身體質量指數(Body Mass Index,BMI)
weight = round(float(input("Enter your weight in Kg: ")))
print(weight, "Kg")
height = round(float(input("Enter your height in CM: ")))
print(height,"CM")
bmi = round(weight / (height/100) ** 2 )
if bmi < 18.5:
print(f"Your BIM is {bmi}, your are under-weighted!!!")
elif bmi < 23:
print(f"Your BIM is {bmi}, your are in normal range!!!.")
elif bmi < 25:
print(f"Your BIM is {bmi}, your are over-weighted!!!")
else:
print(f"Your BIM is {bmi}, your are obese!!!")
Python
INFO