Concatenating Strings

Chris Angelico rosuav at gmail.com
Thu Apr 9 14:46:53 EDT 2015


On Fri, Apr 10, 2015 at 4:44 AM, Andrew Farrell <amfarrell at mit.edu> wrote:
> I am under the impression that using format() is the canonically "right way
> to do it". It is certainly more readable than using ''.join() and is more
> semantically specific than string addition.

Depends what you're doing. Sometimes it's better to interpolate, but
the main point is that addition of three strings is nothing to fear.
Definitely addition of two strings can never be worse than any of the
more complicated alternatives.

ChrisA



More information about the Python-list mailing list