I would add two points to the previous answers:
Strings can be automatically concatenated, which is very convenient:
this_is_a_long_string = ("lkjlkj lkj lkj mlkj mlkj mlkj mlkj mlkj mlkj "
"rest of the string: no string addition is necessary!"
" You can do it many times!")
Note that this is efficient: this does not result in string concatenations calculated when the code is run: instead, this is directly considered as a single long string literal, so it is efficient.
A little caveat related to Devin's answer: the "parenthesis" syntax actually does not "work universally". For instance, d[42] = "H22G" cannot be written as
(d
[42] = "H2G2")
because parentheses can only be used around "calculated" expression (this does not include an assignment (=) like above).
Another example is the following code, which generates a syntax error:
with (open("..... very long file name .....")
as input_file):
In fact, parentheses cannot be put around statements, more generally (only expressions).
In these cases, one can either use the "\" syntax, or, better (since "\" is to be avoided if possible), split the code over multiple statements.