# coding: utf-8
height = float(input('请输入身高:'))
weight = float(input('请输入体重:'))
# coding: utf-8
height = float(input('请输入身高:'))
weight = float(input('请输入体重:'))
BMI = weight / height ** 2
print('小明身高为%s,体重为%s' % (height, weight))
print('小明身高状况指数为%s' % BMI)
if BMI < 18.5:
print('过轻')
elif 18.5 < BMI <= 25:
print('正常')
elif 25 < BMI <=28:
print('过重')
elif 28 < BMI <= 32:
print('肥胖')
else:
print('严重肥胖')
C:\Users\admin\PycharmProjects\pythonlearn\venv\Scripts\python.exe C:/Users/admin/PycharmProjects/python_if/test_5.py
请输入身高:1.65
请输入体重:55
小明身高为1.65,体重为55.0
小明身高状况指数为20.202020202020204
正常
进程已结束,退出代码为 0