title: Get data from dict by using for-loop in Python
body: <p>My input is</p>
  
  <pre><code>[['apple',{'john':3,'anna':4,'kitty':6}],['pear',{'john':4,'anna':3,'kitty':3}]]
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>{
      'key':['apple','pear'],
      'value':[
          {
              'name':'john',
              'data':[3,4]
          },
          {
              'name':'anna',
              'data':[4,3]
          },
          {
              'name':'kitty',
              'data':[6,3]
          }
      ]
  }
  </code></pre>
  
  <p>The <code>key</code> is a list which conclude the first part of each item, such as 'apple' 'pear', and the <code>value</code> is another list.</p>
  
  <p>How should I do it? </p>