title: Getting 'dict_keys' object does not support indexing despite casting to list
body: <p>I am using Python 3 and despite of casting to list, I cannot seem to run my program.</p>
  
  <p>This is the function calling:</p>
  
  <pre><code>path = euleriancycle(edges)
  </code></pre>
  
  <p>And this is where I have used the keys method:</p>
  
  <pre><code>def euleriancycle(e):
      currentnode = list[e.keys()[0]]
      path = [currentnode]
  </code></pre>
  
  <p>I tried to run it without type-casting to list and got this error. After rummaging about this site and similar queries, I followed the solutions suggested and type-cast to list but to no avail. I got the same error. </p>
  
  <p>This is the error track:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-56-356b905111a9&gt; in &lt;module&gt;()
       45             edges[int(edge[0])] = [int(edge[1])]
       46 
  ---&gt; 47 path = euleriancycle(edges)
       48 print(path)
  
  &lt;ipython-input-56-356b905111a9&gt; in euleriancycle(e)
        1 def euleriancycle(e):
  ----&gt; 2     currentnode = list[e.keys()[0]]
        3     path = [currentnode]
        4 
        5     while true:
  
  TypeError: 'dict_keys' object does not support indexing
  </code></pre>