标签:python
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
原文地址:http://891002.blog.51cto.com/882365/1847095