title: Avoiding typing redundancy when generating strings with elements separated by a token
body: <p>Lets say I have a list of words and I want to print them all separated by a comma and a space. So, for example, lets say the list <code>l</code> contains the items <code>['banana', 'apple', 'pear']</code> and I would like to produce the string <code>"banana, apple, pear"</code></p>
  
  <p>Now, the approach I would use to solve the problem is as follows:</p>
  
  <pre><code>s = ""
  s += l[0]
  for i in range(1, len(l)):
      s += ", %s" % l[i]
  </code></pre>
  
  <p>Or something very similar to the above. The problem is the the extra assignment on line 2 seems a little bit messy and redundant, seeing as it's almost identical to line 4 with the exception of adding a comma and a space. While this isn't too much of a problem for very small expressions, it can get rather annoying and unpleasant looking for large expressions. For example if instead of <code>l[0]</code>, we might have <code>foo(bar(l[0]) + foobar(l[0]) + ...</code> which just doesn't feel right to have to repeat the very similar statement just a couple lines below. Is there a better way of achieving the result desired without the extra redundancy? This could include answers specific to the python standard libraries or a general pattern that could be used across multiple languages.</p>