biglist = [['Bob', 10], ['Karl', 12], ['Judy', 11]]
customsort(biglist)
应该返回:
biglist = [['Bob', 10], ['Judy', 11], ['Karl', 12]]
答案 0 :(得分:1)
>>> biglist = [['Bob', 10], ['Karl', 12], ['Judy', 11]]
>>> sorted(biglist, key=lambda x:x[1])
[['Bob', 10], ['Judy', 11], ['Karl', 12]]