【发布时间】:2013-05-27 22:25:39
【问题描述】:
我发现很多线程可以按here 之类的值进行排序,但它似乎对我不起作用...
我有一本包含元组的列表字典。每个列表都有不同数量的元组。我想按每个列表包含多少元组对字典进行排序。
>>>to_format
>>>{"one":[(1,3),(1,4)],"two":[(1,2),(1,2),(1,3)],"three":[(1,1)]}
>>>for key in some_sort(to_format):
print key,
>>>two one three
这可能吗?
【问题讨论】:
标签: python sorting dictionary