Joining strings in Python

under Python, Strings, English

There is already a lot of good material to read about performance. Therefore, it is best to use the following method: >>> print ' '.join(['The', 'fox', 'jumped', 'over', 'the', 'dog.']) The fox jumped over the dog. Perfect. We have very fast string contatenation that even allows us to choose separator. Now, here is the problem: >>> print ', '.join(['apples', 'oranges', '', 'cocos']) apples, oranges, , ...