首页 > 编程语言 > 详细

第一天--简单使用python-编写体重指数BMI

时间:2016-09-07 11:06:33      阅读:1450      评论:0      收藏:0      [点我收藏+]
height = input(‘你的身高是多少M:‘)
height = float(height)
if 0.01<=height<=2.24:
   print()
elif height<=0:
  print("你确定你是人吗?")
else:
   exit(‘请输入正确的值‘)
weight =  input(‘你的体重是多少KG:‘)
weight = float(weight)
BMI = weight/(height*height)
if BMI >=30:
  print(‘重度肥胖‘)
elif  BMI>=27:
  print(‘肥胖‘)
elif BMI>=24:
  print(‘偏胖‘)
elif BMI>=18.5:
   print(‘正常‘)
else:
 print(‘偏瘦‘)


本文出自 “出来乍到” 博客,请务必保留此出处http://891002.blog.51cto.com/882365/1847095

第一天--简单使用python-编写体重指数BMI

原文:http://891002.blog.51cto.com/882365/1847095

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!