title: dict_key object does not support indexing-python 3
body: <p>I am getting an error saying "dict_key object does not support indexing" at:</p>
  
  <pre><code>return len(G[G.keys()[0]])
  </code></pre>
  
  <p>I realised it used to work in python 2.7.x but not in python 3.How should i change this statement to make it work in python 3.</p>