title: Create an array of dictionaries from a Python list
body: <p>I want to turn a list of interspersed values into an array of dictionaries. </p>
  
  <p>I'm trying to make a list of prediction values in Python capable to be used with a JSON API. Once I have the dictionary, I'll use <code>json.dumps</code> on it.</p>
  
  <pre><code>my_list = [35, 2.75, 67, 3.45] # in form of: (value, score, value, score)
  </code></pre>
  
  <p>Ideal outcome:</p>
  
  <pre><code>my_array_of_dicts = [{'value':35, 'score':2.75}, {'value':67 'score':3.45}]
  </code></pre>
  
  <p>Here's what I've tried.</p>
  
  <p>First attempt:</p>
  
  <pre><code>d = dict(zip(my_list[::2], my_list[1::2]))
  </code></pre>
  
  <p>And it produces...</p>
  
  <pre><code>&gt; {35: 2.75,
     67: 3.45}
  </code></pre>
  
  <p>I'm not sure how to get custom keys. Or have each pair as its own dictionary.</p>
  
  <p>Second attempt:</p>
  
  <pre><code>[{'value':i, 'score':i} for i in my_list]]
  
  &gt; [{'value':35, 'score':35}, {'value':2.75, 'score':2.75}, 
     {'value':67, 'score':67}, {'value':3.45, 'score':3.45}] 
  </code></pre>
  
  <p>It's close but it doesn't account for every second value being a score.</p>