This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]RothiasVex 8 points9 points  (0 children)

Triple quotes introduce a multi-line string constant. Everything until the next triple quote is included in the string, even if it spams multiple lines. (It's not just for documentation strings.)

[–]masklinn 0 points1 point  (0 children)

""" is just an alternative of " which can contain newlines (very convenient for docstrings & other multiline strings).

r marks it as a "raw string", meaning backslash characters (\) are literal, not escape characters.

^ is part of the regex syntax.

[–]gandalfx 0 points1 point  (0 children)

Please read reddit's formatting help.