Python小操作:计算身体BMI 代码如下:
heght=float(input(‘你的身高:’))
weight=float(input(‘你的体重:’))
BMI=weight/(heght*heght)
if BMI<18.5:
print(‘偏瘦’)
elif BMI>=18.5 and BMI<24:
print(‘正常’)
elif BMI>=24 and BMI<28:
print(‘偏胖’)
else:
print(‘肥胖’)
print(BMI)
Python实现测量身体BMI
于 2023-04-23 11:00:50 首次发布