Discuss / Python / 交作业~

交作业~

Topic source

無淣

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

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

height=input('身高(m):')

height=float(height)

weight=input('体重(kg):')

weight=float(weight)

BMI=weight/height**2

if BMI<18.5:

print('BMI=',BMI,',过轻')

elif BMI<=25:

print('BMI=',BMI,',正常')

elif BMI<=28:

print('BMI=',BMI,',过重')

elif BMI<=32:

print('BMI=',BMI,',肥胖')

else:

print('BMI=',BMI,',严重肥胖')


  • 1

Reply