L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)] def by_score(t): return t[:][1] L2 = sorted(L, key=by_score)print(L2)
Standard input is empty
[('Bart', 66), ('Bob', 75), ('Lisa', 88), ('Adam', 92)]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!