How can I define python multi line string containing """ (3 double quotes)
my desired output is
"""
TEST
"""
Reason: I am writing a script to create some boilerplate code.
Use triple single quotes:
'''
"""Test"""
'''
The solution with ''' should work, but just for the case you need both of them in a string, you can predefine a string with one of them, such as
TRIPSING = "'''"
TRIPDOUB = '"""'
and then
MYSTRING = TRIPDOUB + "\nTEST\n" + TRIPDOUB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With