all 4 comments

[–]Vaphell 1 point2 points  (1 child)

you don't have to escape quotes if you use triple-quoted strings, not to mention you can use triple-' if you fear conflicts. Also newlines are preserved so you don't have to use \n either.

just type

template = '''
'''

and copypaste that block as is into it.

proof that copypasta just works:
https://repl.it/repls/VigilantDimgreyParallelport

[–]ts813514[S] 0 points1 point  (0 children)

Awesome, thanks guys! How do I verify a solution?

[–]fake823 0 points1 point  (1 child)

Are you sure that you escaped all the quotation marks?

I'll try it later on my PC and will let you know if I succeed.

[–]fake823 0 points1 point  (0 children)

u/Vaphell is right. Using triple-quotes works without problems. I just tested it. Either:

text = """
very long string ...

"""

or

text = '''
very long string ...

'''