title: Can't iterate python dictionary. ( 'list' object has no attribute 'items' on line 13 in main.py)
body: <p>I'm trying to iterate all elements in <code>map</code>(dictionary). But I'm getting this error. Why does it say <code>dict</code> as <code>list</code>? And how do we resolve this problem?</p>
  
  <blockquote>
    <p>'list' object has no attribute 'items' on line 13 in main.py</p>
  </blockquote>
  
  <pre><code>def thirdfarthestdistance(arr,x):
    map = {}
    for elem in arr:
      # Storing {(5, -3), (distance, element)}
      map[abs(elem-x)] = elem
  
    map = sorted(map)
    count = 0
  
    for key, value in map.items: # I tried map.items() too but didn't work.
      print(value)
      # if count == 2:
      #   return elem
      count = count + 1
  
  print(thirdfarthestdistance([-3, -2, -1, 4, 7], 2))
  </code></pre>