Python 'SyntaxError: unexpected character after line continuation character' occurring?
Your issue is that you miss understood the syntax of strings, you did this:
- 'Text '\n'another text'
- ^~~^
As you can see here, To write strings, you can use single quotes or double quotes.
- "string" or 'string'
And to add new lines:
- "String\n"
What you did is that you ended the first string ‘Text ‘, then you put the newline character without strings quotes, then started a new string.
Python’s syntax doesn’t work this way, I know this is confusing, but take your time understanding it.
- "String \n New Line \n Another one \n Another one"
- 'String \n New Line \n Another one \n Another one'
As you can see here, you use the newline character inside (not outside) the string quotes, whether you use double or single quotes.
I recommend playing with it using the Python IDLE that comes with its package, and try to understand how this syntax works.
I hope this is helpful, Good luck!