本文目录一览:
python bmi公式怎么用
weight=int(raw_input("请输入体重(千克):"))
height=int(raw_input("请输入身高(米):"))
BMI=weight/(height*height)
print "BMI=",BMI
if BMI19:
print“轻体重"
elif BMI=19 and BMI25:
print"健康身体"
elif BMI=25 and BMI28:
print"超重“
else:
print"肥胖”
raw_input("press any key to quit.")
Python计算BMI值
废话不多说,改进版继续上程序哈:
def bmi():
name=input('Name:')
height=input('Height(m):')
weight=input('Weight(kg):')
BIM=float(float(weight)/(float(height)**2))
print('您的BIM指数为:',BIM)
if BIM 18.5:
print('你太轻了!')
elif BIM=25:
print('标准体重哦哦!')
elif BIM=32:
print('您有点微胖哦哦!')
else:
print('您太胖了,该减肥了')
bmi()
for i in range(10):
choose =input('您是否愿意继续计算BMI(y/n):')
if choose=='y':
bmi()
else:
break
怎么用python算bmi 简单编程 在线等
weight=int(raw_input("请输入体重(千克):"))
height=int(raw_input("请输入身高(米):"))
BMI=weight/(height*height)
print "BMI=",BMI
if BMI19:
print“轻体重"
elif BMI=19 and BMI25:
print"健康身体"
elif BMI=25 and BMI28:
print"超重“
else:
print"肥胖”
raw_input("press any key to quit.")
怎样用python计算bmi
weight=int(raw_input("请输入体重(千克):"))
height=int(raw_input("请输入身高(米):"))
BMI=weight/(height*height)
print "BMI=",BMI
if BMI19:
print“轻体重"
elif BMI=19 and BMI25:
print"健康身体"
elif BMI=25 and BMI28:
print"超重“
else:
print"肥胖”
raw_input("press any key to quit.")
python语言计算BMI值,感谢求解!
sg = input('你的身高多少(米):')
tz = input('你的体重多少(公斤):')
BMI = round(float(tz) / float(sg) ** 2, 1)
if BMI 18.5:
print('BMI={0},{1}'.format(BMI, '偏瘦'))
elif 18.5 = BMI 24.9:
print('BMI={0},{1}'.format(BMI, '标准'))
elif 25.0 = BMI 29.9:
print('BMI={0},{1}'.format(BMI, '超重'))
elif 25 = BMI:
print('BMI={0},{1}'.format(BMI, '肥胖'))
这是委托我读五年级的儿子写的。^_^