Discuss / Python / 交作业~

交作业~

Topic source

LaDOT

#1 Created at ... [Delete] [Delete and Lock User]
bmi=round(bmi,2)
print('你的BMI为',bmi)
if bmi<=18.5:
    print('过轻')
elif bmi<=25:
    print('正常')
elif bmi <=28:
    print('过重')
elif bim<=32:
    print('肥胖')
else:
    print('严重肥胖')

LaDOT

#2 Created at ... [Delete] [Delete and Lock User]
# -*- coding: utf-8 -*-
h=input('身高:(cm)')
w=input('体重:(kg)')
h=int(h)/100
w=int(w)
bmi=w/h/h
bmi=round(bmi,2)
print('你的BMI为',bmi)
if bmi<=18.5:
    print('过轻')
elif bmi<=25:
    print('正常')
elif bmi <=28:
    print('过重')
elif bim<=32:
    print('肥胖')
else:
    print('严重肥胖')

  • 1

Reply