Discuss / Python / 练习打卡

练习打卡

Topic source
height = float(input('请输入身高(单位:米):'))weight = float(input('请输入体重(单位:千克):'))print('小明身高%s米,体重%s千克' % (height, weight))result = weight / (height * height)print('BMI:', result, end='---')if result < 18.5:    print('过轻')elif result >= 18.5 and result < 25:    print('正常')elif result >= 25 and result < 28:    print('过重')elif result >= 28 and result < 32:    print('肥胖')else:    print('严重肥胖')

  • 1

Reply