python sorted list 包含元組 字典 的多列排序

#包含字典dict的列表list的排序方法與dict的排序相似,以下: import operator x = [{'name':'homer', 'age':39}, {'name':'bart', 'age':10}, {'name':'aart', 'age':20}, {'name':'aart', 'age':10}] print x sorted_x = sorted(x, key=l
相關文章
相關標籤/搜索