• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
13 views

Problem :

My Python program is giving below error
python unexpected character after line continuation character
by (6.9k points)  

1 Answer

0 votes

Solution:

Here backslash \ is the line continuation character the error message is talking about, and after it, only newline characters/whitespace are allowed

print "This is a very long string that doesn't fit" + \
      "on a single line"

Outside of a string, a backslash can only appear in this way. For division, you want a slash: /.

If you want to write a verbatim backslash in a string, escape it by doubling it: "\\"

Further Readings:

https://github.com/maxpumperla/deep_learning_and_the_game_of_go/issues/5

by (21.9k points)  
edited by
...