Discuss / Python / 交作业,有变化版

交作业,有变化版

Topic source

height = input('Please tell us how tall you are(in meters):',)

weight = input('Please tell us how heavy you are(in kg):',)

height = float(height)

weight = float(weight)

BMI = weight/height**2

if BMI <18.5:

    print('too slim')

elif BMI <25:

    print('normal')

elif BMI <28:

    print('too heavy')

elif BMI <32:

    print('fat')

else:

    print('FAT!!!')


  • 1

Reply