python: utilization of a list in a two level dict
<p>How can I initialize a list in a two level dict in a pythonic way?</p>

<pre><code>pos = defaultdict(dict)
pait = "2:N"
cars = ["bus","taxi"]
for x in cars:
    pos[x][pait]=[]
</code></pre>

<p>Python's list and dictionary comprehensions come in handy for one-line initialization.</p>

<pre><code>pos = {x: {"2:N": []} for x in ["bus", "taxi"]}
</code></pre>

python