【发布时间】:2019-01-25 06:53:53
【问题描述】:
我不明白为什么我的 elif 语句出现错误。
我正在使用 eclipse 插件 pydev 和最新版本的 python。
例如,
if sum(player_cards) = 14 and sum(computer_cards) = 10
这应该输出为True
elif sum(player_cards) > sum(computer_cards) and < 21 :
相反,它给了我这个:
“在第 42 行第 54 列遇到“
【问题讨论】:
-
sum(player_cards) > sum(computer_cards)
-
异常中明确说明了该问题。花更多时间了解异常。
-
那么为什么删除“and”会修复语法错误?为什么不用告诉它“和” int?
标签: python and-operator