height = float(input('请输入身高:'))
weight = float(input('请输入体重:'))
BMI=float(weight/float((height*height)))
if BMI<18.5:
print('过轻')
elif BMI>=18.5 and BMI<=25:
print('正常')
elif BMI>=25 and BMI<=28:
print('过重')
else :
print('严重肥胖')
height = float(input('请输入身高:'))
weight = float(input('请输入体重:'))
BMI=float(weight/float((height*height)))
if BMI<18.5:
print('过轻')
elif BMI>=18.5 and BMI<=25:
print('正常')
elif BMI>=25 and BMI<=28:
print('过重')
else :
print('严重肥胖')
本文标题:python身体质量指数(BMI)计算
本文链接:https://www.haomeiwen.com/subject/kkdvpqtx.html
网友评论