Discuss / Python / 作业题答案

作业题答案

Topic source

倾客回眸

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

#-*- coding:utf-8 -*-

height = input("请输入身高:")

print(type(height))

height = float(height)

print("weight:",height,type(height))

weight = input('请输入体重:')

weight = float(weight)

BMI = weight / height / height

if BMI < 18.5 and BMI >0:

    print('过轻')

elif BMI >= 18.5 and BMI < 25:

    print('正常')

elif BMI >= 25 and BMI <28 :

    print("过胖")

elif BMI >= 28 and BMI < 32:

    print('肥胖')

elif BMI > 32:

    print('严重肥胖')

else:

    print("您输入的内容有误,请重新输入")


  • 1

Reply