Discuss / Python / #打卡

#打卡

Topic source

sober°_

#1 Created at ... [Delete] [Delete and Lock User]

h = input('please input your height:(//cm)')

height = int(h) / 100

w = input('please input your weight:(//kg)')

weight = int(w)

bmi = weight/(height**2)

print(f'你的身高为{height}cm,你的体重为{weight}kg,BMI指数为{bmi:.2f}')

if bmi > 32:

    print('严重肥胖')

elif bmi > 28:

    print('肥胖')

elif bmi > 25:

    print('过重')

elif bmi > 18.5:

    print('正常')

else:

    print('细狗TAT')

sober°_

#2 Created at ... [Delete] [Delete and Lock User]

第一个print()内应该是{height}m

.,.

#3 Created at ... [Delete] [Delete and Lock User]

最好改成float


  • 1

Reply