Most pythonic way to initialize a dict
<p>Suppose I have a dict like this</p>

<pre><code>d = {
    1: [1,4,7],
    2: [2,5,8],
    0: [3,6,9]       
}
</code></pre>

<p>It can be constructed by</p>

<pre><code>d = {}

for i in range(1,10):
    key = i % 3
    if key not in d: d[key] = []
    d[key].append(i)
</code></pre>

<p>I used this line <code>if key not in d: d[key] = []</code> to check existence of the key/value pair in the dict and initiate the pair. </p>

<p>Is there a more pythonic way to achieve this?</p>