Discuss / Python / 交作业

交作业

Topic source

Mr_小惡米

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

height=1.75

weight=80.5

BMI=weight/(height*height)

if BMI >32:

    print('您的BMI为:%.2f'%BMI,',严重肥胖')

elif BMI>28:

    print('您的BMI为:%.2f'%BMI,',肥胖')

elif BMI >25:

    print('您的BMI为:%.2f'%BMI,',过重')

elif BMI>18.5:

    print('您的BMI为:%.2f'%BMI,',正常')

else:

    print('您的BMI为:%.2f'%BMI,',过轻')


  • 1

Reply