九州体育网 - 十年信誉网站

关于作者

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

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

Topic source

柳叶赵

#1 Created at ...

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 ...

后面两个冒号是中文的

茅毛毛blingbling

#3 Created at ...

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


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.