身体质量指数BMI
height = float(input())
weight = float(input())
# 计算bmi值并将判断结果输出
bmi = weight/ (height*height)
'''bmi = weight/pow(height,2)'''
print("BMI数值为:%.2f"%bmi)
'''print("BMI数值为:{:.2f}".format(bmi))'''
out, In = "",""
if bmi<18.5:
out , In ="偏瘦","偏瘦"
elif 18.5<=bmi<24:
out , In ="正常","正常"
elif 24<=bmi<25:
out , In ="正常","偏胖"
elif 25<=bmi<28:
out , In ="偏胖","偏胖"
elif 28<= bmi < 30:
out , In ="偏胖 ","肥胖"
else:
out , In ="肥胖","肥胖"
print("BMI指标为:国际'{0}',国内'{1}'".format(out,In))
结果:
BMI数值为:14.53
BMI指标为:国际'偏瘦',国内'偏瘦'
版权声明:本文为EchoLWH原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。