height = input('height(m):') weight = input('weight(kg):') a=float(height) b=int(weight)
bmi=b/a**2 print('bmi=','%.2f' % bmi) if bmi>32: print('过度肥胖') elif bmi<=32 and bmi>25: print('肥胖') elif bmi<=25 and bmi>18.5: print('正常') elif bmi<18.5: print('过轻')
Sign in to make a reply
吾王思佳
height = input('height(m):') weight = input('weight(kg):') a=float(height) b=int(weight)
bmi=b/a**2 print('bmi=','%.2f' % bmi) if bmi>32: print('过度肥胖') elif bmi<=32 and bmi>25: print('肥胖') elif bmi<=25 and bmi>18.5: print('正常') elif bmi<18.5: print('过轻')