title: How to update and access subkeys of a dict in a dict [python]
body: <p>I am using a dict in a dict to count four parameters related to 20 items.</p>
  
  <pre><code>resi = {'a': {'x': 0, 'y': 0, 'z': 0}, 'b': {'x': 0, 'y': 0, 'z': 0}, ...}
  </code></pre>
  
  <p>The function 'count' counts the frequency of parameters x, y, z occurring with 20 items. </p>
  
  <p><code>re</code>: a key in main dict <code>resi</code>; <code>bas</code> : a key in the nested dict</p>
  
  <pre><code>def count(re, bas, aa = resi) :
      t = aa[re] 
      t[bas] += 1
      print aa
  </code></pre>
  
  <p>When the function is called, <code>count</code> updates the parameter in all main keys. I also tried</p>
  
  <pre><code>aa[re][0][bas] += 1
  </code></pre>
  
  <p>This shows a key error. How do I update a specific key in main dict? </p>