Discuss / Python / 交作业

交作业

Topic source

1M_sunshine

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

#   假意注释一下

# -*- coding: utf-8 -*-

#低于18.5:过轻

#18.5-25:正常

#25-28:过重

#28-32:肥胖

#高于32:严重肥胖

height=float(input('请输入你的身高(m):'))

weight=float(input('请再输入的的体重(kg):'))

bmi=round(weight/(height**2),1)

if bmi<18.5:

    print('你的BMI指数为:',bmi,'过轻')

elif 18.5<=bmi<25:

    print('你的BMI指数为:',bmi,'正常')

elif 25<=bmi<=32:

    print('你的BMI指数为:',bmi,'肥胖')

else:

    print('你的BMI指数为:',bmi,'严重肥胖')

hanxiaoli007

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

可以吗    我为什运行报错呢?


  • 1

Reply