Python SyntaxError: EOL while scanning string literal

It means you have to escape string.

For example

Instead of this:

text = "\a \b \c"
if text.startswith("\c")
return True

Use this:

text = "\a \b \c"
if text.startswith("\\c")
return True

Escape with slash.

Written by

Don’t follow me. I wrote junks here. Follow me on Twitter instead.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store