title: dict.update() not working as expected
body: <p>I have an empty dictionary, which I am manipulating with the update method. I am using a variable as the key and <code>+1</code> as the value. See below:</p>
  
  <pre><code>myDict, var = {}, 10
  myDict.update( { var : +1 } )
  </code></pre>
  
  <p>Let's say I execute this twice, I expect <code>myDict = {10 : 2}</code>. Instead, it is <code>{10 : 1}</code>. </p>
  
  <p>I understand I can directly resolve this issue by doing this:</p>
  
  <pre><code>myDict[var] += 1
  print (myDict)
  {10 : 2}
  </code></pre>
  
  <p>However, <code>var</code> is not always <code>10</code> I would like to increment, <code>var</code> can be any number. If it was any number other than <code>10</code>, I would get a <code>KeyError</code> as the key does not exist in the dictionary. </p>
  
  <p>How can I update the dictionary with a variable as the key, and set the value as <code>1</code>, but if the key already exists in <code>myDict</code>, then to increment the respective value instead?</p>
  
  <p>I have already done this through a try and except statement but I feel it is not very Pythonic. </p>
  
  <pre><code>try:
      myDict[var] += 1
  except:
      myDict.update( { var : 1 } )
  </code></pre>
  
  <p>This way, it will try to increment <code>var</code>'s value by one. If the key doesn't exist, then <code>myDict</code> will be updated instead to create the key and set the value as one. Is there a better way?</p>