Discuss / Python / 作业

作业

Topic source

Gussun

#1 Created at ... [Delete] [Delete and Lock User]
h=input('请输入您的身高:')
w=input('请输入您的体重:')

height=float(h)
weight=float(w)

bmi=weight/(height*height)

print('您的BMI指数为%.2f' %(bmi))

if bmi>32:
    print('过于肥胖')
elif bmi>28:
    print('肥胖')
elif bmi>25:
    print('过重')
elif bmi>18.5:
    print('正常')
else:
    print('过轻')

  • 1

Reply