title: In Python, is there an elegant way to print a list in a custom format without explicit looping?
body: <p>I know you can do </p>
  
  <pre><code>print str(myList)
  </code></pre>
  
  <p>to get  </p>
  
  <pre><code>[1, 2, 3]
  </code></pre>
  
  <p>and you can do</p>
  
  <pre><code>i = 0
  for entry in myList:
    print str(i) + ":", entry
    i += 1
  </code></pre>
  
  <p>to get  </p>
  
  <pre><code>0: 1  
  1: 2  
  2: 3    
  </code></pre>
  
  <p>But is there a way similar to the first to get a result similar to the last?</p>
  
  <p>With my limited knowledge of Python (and some help from the documentation), my best is:</p>
  
  <pre><code>print '\n'.join([str(n) + ": " + str(entry) for (n, entry) in zip(range(0,len(myList)), myList)])
  </code></pre>
  
  <p>It's not much less verbose, but at least I get a custom string in one (compound) statement.
  Can you do better?</p>