Thu 18 May 2006
Python triple-quoted strings
Posted by dkaz under Python
As a Python newbie, I was a bit perplexed by the “”"-delimited strings…
From python.org:
In triple-quoted strings, unescaped newlines and quotes are allowed (and are retained), except that three unescaped quotes in a row terminate the string. (A “quote'’ is the character used to open the string, i.e. either ‘ or “.)

August 5th, 2006 at 4:22 am
They can be used when you need multi-line strings (a bit like Perl here documents), or they are great when you have a string literal that has single and double quote as you can triple quote the whole thing without escaping, e.g:
my_string = “”"She’d said “Oh No”!”"”
- Paddy