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?
This is my code so far: import pickle
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 (("{} --> {}").format(key, value))