2014-10-20 2 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

+1

좀비를위한 수명 말기를 사용하십시오. 그게 뭐가 잘못 됐니? –

+1

@okiharaherbst :하지만 이미 죽은 것을 어떻게 죽일 수 있습니까? : P – abarnert

답변

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

문자열 리터럴을.

관련 문제