title: Python raises a KeyError (for an out of dictionary key) even though the key IS in the dictionary
body: <p>I'm getting a KeyError for an out of dictionary key, even though I know the key IS in fact in the dictionary. Any ideas as to what might be causing this?</p>
  
  <pre><code>print G.keys()
  </code></pre>
  
  <p>returns the following:</p>
  
  <pre><code>['24', '25', '20', '21', '22', '23', '1', '3', '2', '5', '4', '7', '6', '9', '8', '11', '10', '13', '12', '15', '14', '17', '16', '19', '18']
  </code></pre>
  
  <p>but when I try to access a value in the dictionary on the next line of code...</p>
  
  <pre><code>for w in G[v]:    #note that in this example, v = 17
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>KeyError: 17
  </code></pre>
  
  <p>Any help, tips, or advice are all appreciated. Thanks.</p>