2014-10-20 42 views
1

它不斷想出EOL while scanning string literal但這是什麼意思?爲什麼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.") 
+1

您不會在行尾關閉字符串文字。爲了解決這個問題,請使用三重引號 - 「」「」字符串文本...「」「'' – MattDMo 2014-10-20 20:01:58

+1

殭屍的終結。那有什麼問題? – 2014-10-20 20:03:21

+1

@okiharaherbst:但你怎麼能殺死那已經死了的東西? :P – abarnert 2014-10-20 20:05:56

回答

3

這意味着你的字符串文字格式不正確。您需要使用三重引號的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.""") 

字符串文字。