体脂率案例

personHeight =  input("请输入你的身高(m)")
personHeight = float(personHeight)

personWeight = input("请输入你的体重(kg)")
personWeight = float(personWeight)

personAge = input("请输入你的年龄:")
personAge = int(personAge)

personSex = int(input("请输入你的性别(男:1,女:0)"))
personSex = int(personSex)
BMI = personWeight / (personHeight * personHeight)
TZL = 1.2 * BMI + 0.23 * personAge - 5.4 - 10.8 * personSex


minNum = 0.15 + 0.10 * ( 1 - personSex )
maxNum = 0.18 + 0.10 * ( 1 - personSex )

re = minNum <= TZL <= maxNum
print("你的体脂率是:%f" % TZL )
print("你的体脂率是否符合标准",re)

print(minNum,maxNum)

猜你喜欢

转载自www.cnblogs.com/houchaoying/p/12957409.html
今日推荐