title: Python: How to not print comma in last element in a for loop?
body: <p>My code iterates over a set and print actor's names:</p>
  
  <pre><code>for actor in actorsByMovies():
      print actor+",",
  </code></pre>
  
  <p>The result looks like:</p>
  
  <pre><code>Brad Pitt, George Clooney,
  </code></pre>
  
  <p>But I want it to detect the last element so that it won't print the last comma. The result should be instead:</p>
  
  <pre><code>Brad Pitt, George Clooney
  </code></pre>
  
  <p>How can I do that?</p>