How does this Lambda Expression work?
<p>I'm familiar with simple lambda expressions. However I have this lambda expression in a book.</p>

<pre><code>dd_pair = defaultdict(lambda: [0,0])
dd_pair[2][1] = 1    #now dd_pair contains {2: [0,1]}
</code></pre>

<p>I didn't declare any input variables, which is not how I learned Lambdas.</p>

<p>The previous example from the book has</p>

<pre><code>dd_dict = defaultdict(dict)
dd_dict["Joel"]["City"] = "Seattle"
#this produces {"Joel" : { "City": "Seattle"}}
</code></pre>

<p>This makes sense, The Key is <code>Joel</code>, the nested Key is <code>City</code>, and the value is <code>Seattle</code>.</p>

<p>My two part question is, how does a lambda work with no input variables? and should I assume that the <code>dd_pair[2][1]</code> is to create a key <code>2</code> and at index <code>1</code> of the list set the value <code>=1</code>?</p>