Getting a Syntax Error: EOL while scanning the string literal in Python

597    Asked by FelicityDavies in Python , Asked on Apr 15, 2021

Hey guys. Let's say I have a string a1="a really long string............", as soon as I post this, I getting EOL python error.

How to fixing this error? Appreciate the help!

Answered by Felicity Davies

You need to put a double quote (") at the end of the line to achieve your goal. You can also use """ and get away with it.


This can help you to fix EOL python error:

""" a very long string ...... 
....that can span multiple lines
"""
Let me know if that helps!

Your Answer

Interviews

Parent Categories