Discuss / Python / 运行结果那里不懂

运行结果那里不懂

Topic source

weight=80.5

height=1.75

bmi = weight/(height**2)

if bmi>=32:

    print('严重肥胖')

elif 28<=bmi<32:

    print('肥胖')

elif 25<=bmi<28:

    print('过重')

elif 18.5<=bmi<25:

    print('正常')

else:

    print('过轻')

为什么不对呢?

你elif后面的冒号是中文的,改成英文的就好了


  • 1

Reply