【Python】BMI国内测量

shengao = eval(input('请输入以米为单位的身高(例:1.75):'))
tizhong = eval(input('请输入以公斤为单位的体重(例:60):'))
BMI = tizhong / (shengao**2)
if BMI<18.5:
print('BMI指数为{:.2f},偏瘦!'.format(BMI))
elif 18.5<=BMI<24:
print('BMI指数为{:.2f},正常。'.format(BMI))
elif 24<=BMI<28:
print('BMI指数为{:.2f},偏胖!'.format(BMI))
else:
print('BMI指数为{:.2f},肥胖!该减肥了!'.format(BMI))

原文地址:https://www.cnblogs.com/naraka/p/8855212.html