python-判断体重与身高指数
(2020-12-07 07:41:19)
标签:
python樊胜民教育编程 |
分类: 与樊老师一起学python |
# 作者: 樊胜民
# 编写时间:2020-12-03 10:00
height = float(input("输入身高(米):"))
weight = float(input("输入体重(千克):"))
bmi = weight / (height * height) #计算BMI指数
if bmi<<span style="color:#6897bb;">18.5:
print("BMI指数为:"+str(bmi))
print("偏瘦,加强营养")
elif bmi>=18.5 and bmi<<span style="color:#6897bb;">24.9:
print("BMI指数为:"+str(bmi))
print("正常,注意保持")
elif bmi>=24.9 and bmi<<span style="color:#6897bb;">29.9:
print("BMI指数为:"+str(bmi))
print("偏胖")
else:
print("BMI指数为:"+str(bmi))
print("肥胖")
前一篇:python-判断奇数与偶数
后一篇:python-判断成绩登记

加载中…