title: Append value to list in dictionary with existing or non-existing key in Python
body: <p>I have a for loop that goes through two lists and combines them in dictionary. Keys are strings (web page headers) and values are lists (containing links).</p>
  
  <p>Sometimes I get the same key from the loop that already exists in the dictionary. Which is fine. But the value is different (new links) and I'd like to update the key's value in a way where I append the links instead of replacing them.</p>
  
  <p>The code looks something like that below. Note: <code>issue_links</code> is a list of URLs</p>
  
  <pre><code>for index, link in enumerate(issue_links):
      issue_soup = BeautifulSoup(urllib2.urlopen(link))
      image_list = []
      for image in issue_soup.findAll('div', 'mags_thumb_article'):
          issue_name = issue_soup.findAll('h1','top')[0].text
          image_list.append(the_url + image.a['href'])
  
      download_list[issue_name] = image_list
  </code></pre>
  
  <p>Currently the new links (<code>image_list</code>) that belong to the same <code>issue_name</code> key get overwritten. I'd like instead to append them. Someone told me to use <code>collections.defaultdict</code> module but I'm not familiar with it.</p>
  
  <p>Note: I'm using <code>enumerate</code> because the index gets printed to the console (not included in the code).</p>