title: What exactly does the type lambda do when used with defaultdict
body: <p>I remember this example</p>
  
  <pre><code>from collections import defaultdict
  d_int = defaultdict(int, a=10, b=12, c=13)
  d_int.default_factory = lambda: 1
  d_int['d']
  1
  </code></pre>
  
  <p>When we pass an unknown key it returns the default value instead of error,I understand this.
  But in this SO question,<a href="https://stackoverflow.com/questions/45646576/populating-a-nested-dictionary">populating a nested dictionary</a> thing get more complicated.</p>
  
  <pre><code>final = collections.defaultdict(lambda: collections.defaultdict(list))
  </code></pre>
  
  <p>What does lambda type do in this case?</p>