Discuss / Python / 运行到“过重”后出现语法错误

运行到“过重”后出现语法错误

Topic source

柳叶赵

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

bmi = weight/(height*height) if bmi>32: print('严重肥胖') elif bmi>28.5: print('肥胖') elif bmi>25: print('过重') elif bmi>18.5: print('正常') else: print('过轻')

直接运行会报错提示语法错误,但删掉最后两个判断之后能输出 过重

陈日仙

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

后面两个冒号是中文的

这个bmi的设定是不是不够严谨?


  • 1

Reply