Discuss / Python / zuoye

zuoye

Topic source

Xaldan

#1 Created at ... [Delete] [Delete and Lock User]

bmi = weight/height/height

if bmi > 32:

    bmigrad = '严重肥胖'

elif bmi >= 28:

    bmigrad = '肥胖'

elif bmi >= 25:

    bmigrad = '过重'

elif bmi >= 18.5:

    bmigrad = '正常'

else:

    bmigrad ='过轻'

print('小明的BMI指数是:{0:.0f} , 属于:{1}'.format(bmi, bmigrad))


  • 1

Reply