title: Pad list in Python
body: <p>How can I pad a list when printed in python?</p>
  
  <p>For example, I have the following list:</p>
  
  <pre><code>mylist = ['foo', 'bar']
  </code></pre>
  
  <p>I want to print this padded to four indices, with commas. I know I can do the following to get it as a comma and space separated list:</p>
  
  <pre><code>', '.join(mylist)
  </code></pre>
  
  <p>But how can I pad it to four indices with 'x's, so the output is like:</p>
  
  <pre><code>foo, bar, x, x
  </code></pre>