title: appending values to dictionary in for loop
body: <p>Just cant get this working. Any help is highly appreciated.</p>
  
  <pre><code>dict = {}
  for n in n1:
      if # condition #
          dict[key] = []
          dict[key].append(value)
          print dict
  </code></pre>
  
  <p>This is printing something like this</p>
  
  <blockquote>
    <p>{'k1':['v1']} and {'k1':['v2']}</p>
  </blockquote>
  
  <p>I have few other nested for loops down this code, which will be using this dict and the dict has only the latest key value pairs i.e. <code>{'k1':'v2'}</code></p>
  
  <p>I am looking for something like <code>{'k1':['v1','v2']}</code></p>
  
  <p>Please suggest a solution without using <code>setdefault</code></p>