String literal

Concatenation

String literal concatenation can be used to reduce the number of backslashes needed, to split long strings conveniently across long lines, or even to add comments to parts of strings, for example:

s = 'foo' 'bar'
print s
>> foobar
address = ('130 High Street, '
    'Crediton, '
    'Devon')
print address
>> 130 High Street, Crediton, Devon
import re
re.compile("[A-Za-z_]"       # letter or underscore
           "[A-Za-z0-9_]*"   # letter, digit or underscore
          )