I am trying to use the Python print() function with a multi-line string literal —
I am using a vertical ellipsis to indicate multiple lines, not content, of the string literal.
print("Here is the data table:
.
.
. ")
Why am I getting EOL while scanning string literal error.
Why is this happening?
Use
"""or'''for multiline string literals.Edit: as pointed out by @lvc in the comments, since you have parens around the string, you can still use the single quotes, you just have to start and end each line with
".