Python: Triple Quote String

By Xah Lee. Date: . Last updated: .

Triple Quote (For Multi-Line String)

Triple Quote string is a string syntax with 3 quote delimiters on each side.

# triple quoted string, with QUOTATION MARK delimiter
xx = """dog
cat
bird"""

# fmt: off
# triple quoted string, with APOSTROPHE delimiter
yy = '''dog
cat
bird'''
# fmt: on

print(xx == yy)
# True

print(xx)
# dog
# cat
# bird

Python, String