Language Syntax

Triple quoted string — Python syntax

Three matching quotes allow literal newlines and unescaped single quotes of the same kind. Indentation within the literal is preserved; ordinary escape rules still apply unless raw. A triple-quoted expression is only a docstring in the designated first-statement position.

Formal Syntax & Structure

python syntaxpython
'''multi-line text'''

Return Value

str

Value obtained by evaluating this expression; see description for context and constraints.

Working Example

Example Snippetpython
text='''firstsecond'''print(text.splitlines())
Python Reference