izzy04
izzy04

Reputation: 31

Why EOL error and what does it mean?

It keep coming up with EOL while scanning string literal but what does this mean?

This is the section it keeps calling an error:

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

Upvotes: 1

Views: 2019

Answers (1)

user2555451
user2555451

Reputation:

It means that your string literal is malformed. You need to use triple quotes for a 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.""")

String literals enclosed with just single quotes cannot span multiple lines.

Upvotes: 3

Related Questions