title: How to map values from a list to nested dictionaries in Python?
body: <p>I have a list of values, and a dictionary of dictionaries. They look something like this:</p>
  
  <pre><code>d = {1 : {1 : '', 2 : '', 3 : ''},2 : {1 : '', 2 : '', 3 : ''}}
  l = ['Erich Martin', 'Zia Michael', 'Olga Williams', 'Uma Gates']
  </code></pre>
  
  <p>I am trying to map the values from the list into the dictionary, filling each dictionary before moving on to the next nested dictionary. The last dictionary would have some empty slots, and that's fine. I can't seem to wrap my head around what I need to do; I run into the end of the list and get a keyerror, as there are no more values. Here's the gist of what I've got so far:</p>
  
  <pre><code>for g,s in d.items():
          for i in s:
                  s[i] = l.pop()
  </code></pre>
  
  <p>Using Python 3.4.</p>
  
  <p>Thanks!</p>