title: 'dict' object has no attribute 'has_key'
body: <p>While traversing a graph in Python, a I'm receiving this error:</p>
  
  <blockquote>
    <p>'dict' object has no attribute 'has_key'</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>def find_path(graph, start, end, path=[]):
      path = path + [start]
      if start == end:
          return path
      if not graph.has_key(start):
          return None
      for node in graph[start]:
          if node not in path:
              newpath = find_path(graph, node, end, path)
              if newpath: return newpath
      return None
  </code></pre>
  
  <p>The code aims to find the paths from one node to others. Code source: <a href="http://cs.mwsu.edu/~terry/courses/4883/lectures/graphs.html" rel="noreferrer">http://cs.mwsu.edu/~terry/courses/4883/lectures/graphs.html</a></p>
  
  <p>Why am I getting this error and how can I fix it?</p>