遇到的一個問題:將一個列表套列表按照第一個元素進行排序[[2,"2"],[1,"1"],[4,"4"]]web
方法: list1 = [[2,"2"],[1,"1"],[4,"4"]]spa
list2 = sorted( list1,key=lambda x:x[0], reverse = True/False )blog
*注:key是固定的名字,reverse = True 降序,False 升序排序
http://space.wudiweb.com/phychion/blog/94io