How do I wrap long lines in Python without sacrificing on the indentation part?
For example, consider this:
>>> def fun():
print '{0} Here is a really long sentence with {1}'.format(3, 5)
Suppose that this goes over the 79 character recommended limit. The way I read it, here is how to indent it:
>>> def fun():
print '{0} Here is a really long \
sentence with {1}'.format(3, 5)
However, with this approach, there is one problem I have. The indentation of the continued line matches the indentation of the fun()
. This looks kinda ugly. I personally feel if someone was to go through my code, it would look bad to have uneven indentation cause of this print
statement.
My question is: how do I indent lines such as above effectively without sacrificing code readability?