How to write very long string that conforms with PEP8 and prevent E501

As PEP8 suggests keeping below the 80 column rule for your python program, how can I abide to that with long strings, i.e.

s = "this is my really, really, really, really, really, really, really long string that I'd like to shorten."

How would I go about expanding this to the following line, i.e.

s = "this is my really, really, really, really, really, really" + 
    "really long string that I'd like to shorten."

13 Answers
13

Leave a Comment