Cálculo del índice de IMC

# 练习8:BMI指数计算
height, weight = eval(input("请输入身高(米)和体重(公斤)[逗号隔开]: "))
height = float(input("请输入你的身高(单位:米):"))
print("你的身高:", height)
weight = float(input("请输入你的体重(单位:千克):"))
print("你的体重:", weight)
bmi = weight / pow(height, 2)
print("BMI 数值为:{:.2f}".format((bmi)))
who = ""
if bmi < 18.5:
    who = "偏瘦"
elif 18.5 <= bmi < 25:
    who = "正常"
elif 25 <= bmi < 30:
    who = "偏胖"
else:
    who = "肥胖"
print("BMI 指标为:国际'{0}'".format(who))

 

Supongo que te gusta

Origin blog.csdn.net/weixin_44940488/article/details/107601136
Recomendado
Clasificación