How do I split the definition of a long string over multiple lines?
You can split a string over multiple lines by using triple quotes, either ''' or """ .
string = '''This is a long string that spans multiple lines'''
string = """This is a long string that spans multiple lines"""
You can also use the backslash character ( \ ) at the end of each line to achieve a similar effect:
string = "This is a long string \ that spans multiple lines"
Note that when using the backslash, there should not be any whitespace or characters after it on the same line.