title: List of dictionaries with comprehension in python
body: <p>I have the following list of dictionaries:</p>
  
  <pre><code>    ld=[{'a':10,'b':20},{'p':10,'u':100}]
  </code></pre>
  
  <p>I want to write a comprehension like this:</p>
  
  <pre><code>    [ (k,v) for k,v in [ d.items() for d in ld ] ]
  </code></pre>
  
  <p>basically I want to iterate over dictionaries in the list and get the keys and values of each dict and do sth.</p>
  
  <p>Example: One example output of this would be for example another list of dictionaries without some keys:</p>
  
  <pre><code>        ld=[{'a':10,'b':20},{'p':10,'u':100}]
          new_ld=[{'a':10},{'p':10}]
  </code></pre>
  
  <p>However, the above comprehension is not correct. Any help would be appreciated. </p>