加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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("肥胖")

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有