title: Python: Convert a list of dictionary into a table
body: <p>I have this list of sub dictionaries:</p>
  
  <pre><code>my_dict = [ {'type' : 'type_1', 'prob' : 2, 'x_sum' : 3, 'y_sum' : 5}
   {'type' : 'type_2', 'prob' : 3, 'x_sum' : 8, 'y_sum' : 6}]
  </code></pre>
  
  <p>I want a print it as a table:</p>
  
  <pre><code>type  |prob|x_sum|y_sum
  type_1|2   |3    |5
  type_2|3   |8    |6
  </code></pre>
  
  <p>I tried this solution :</p>
  
  <pre><code>for row in zip(*([key] + value for key, value in sorted(my_dict.items()))):
  print(*row)
  </code></pre>
  
  <p>but got error: 
      AttributeError: 'list' object has no attribute 'items'
  How I can fix the list problem?</p>