title: Printing out a 2D list like a table with Python
body: <p>I'm trying to print out a 2D list like a table, and I found a piece of code here:
  <a href="https://stackoverflow.com/questions/13214809/pretty-print-2d-python-list">Pretty print 2D Python list</a></p>
  
  <p>But I couldn't understand how it really works, can anyone please explain to me?</p>
  
  <pre><code>s = [[str(e) for e in row] for row in matrix]
  lens = [max(map(len, col)) for col in zip(*s)]
  fmt = '\t'.join('{{:{}}}'.format(x) for x in lens)
  table = [fmt.format(*row) for row in s]
  print '\n'.join(table)
  </code></pre>