I am trying to make a leaderboard in python and I have the following dict:
points = [("Bob",12),("Steve",7),("Alice",9)]
I am trying to sort it into the following dict:
points = [("Bob",12),("Alice",9),("Steve",7)]
How would I do this programatically.
I have tried
sorteddata = sorted(data,key=itemgetter(1))
to no avail.
Thanks in advance, - Evan