title: Alphabetically sorting a dictionary of basketball teams
body: <p>I am having trouble sorting a dictionary alphabetically.
  So far I have tried various methods but I keep running into errors;</p>
  <p>The list in need of sorting by Team name:</p>
  <pre><code>NBA_teams = {'Atlanta': 'Hawks','Chicago':'Bulls', 'Los Angeles':'Lakers', 'Miami':'Heat', 'Phoenix': 'Suns', 'Toronto': 'Raptors'}
  
  # Method so far:
  
  for i in sorted (NBA_teams) :
      print ((i, NBA_teams[i], end = &quot; &quot;))
  </code></pre>
  <p>Ive also tried lambda but I end up running into this error;</p>
  <pre><code>print(sorted(NBA_teams.items(), key = lambda kv:(kv[1], kv[0])))
  </code></pre>
  <blockquote>
  <p>AttributeError: 'str' object has no attribute 'items'</p>
  </blockquote>
  <p>Is there any way to fix either of these so that I can sort the above dictionary by either Team or Location?</p>