在扫描字符串文字时,它不断出现EOL
,但这是什么意思?
这是它不断调用错误的部分:
if health2 <= 3:
print ("With all the strength you have left you attack one final time to deliver the
finishing blow. The zombie falls to the ground dead as you stand over it victorious. You can
now continue your quest to cross the country.")
最佳答案
这意味着您的字符串文字格式错误。您需要对 multi-line string 使用三引号:
if health2 <= 3:
print ("""With all the strength you have left you attack one final time to deliver
the finishing blow. The zombie falls to the ground dead as you stand over it victorious. You
can now continue your quest to cross the country.""")
仅用单引号括起来的字符串文字不能跨越多行。
关于python - 为什么出现 EOL 错误以及它的含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26473885/