title: Sort dict alphabetically
body: <p>My program can output every student's name and their 3 scores from a dict in a file, but I need to  sort the data by alphabetical order. How can I sort the names and scores alphabetically according to the surname?</p>
  
  <p>This is my code so far:
    import pickle</p>
  
  <pre><code>def clssa():
      filename="friendlist.data"
      f=open('Class6A.txt','rb')
      storedlist = pickle.load(f)
      for key, value in storedlist.items():
          sorted (key), value in storedlist.items()  
          print (("{} --&gt; {}").format(key, value))
  </code></pre>