Discuss / Python / 学以致用

学以致用

Topic source

嗯咦啊哦

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

w = float(input('请输入体重:'))

h = float(input('请输入身高:'))

MBI = w/(h*h)

# print(format(MBI, '.0f'))

if MBI > 32:

    print('%.1f严重肥胖' % MBI)

elif MBI > 28:

    print('肥胖{0:.1f}'.format(MBI))

elif MBI > 25:

    print(f'过重{MBI:.1f}')

elif float(MBI) > 18.5:

    print('正常')

else :

    print('过轻')

print('BMI指数是',MBI)


  • 1

Reply