Python3使用sorted函数对列表元素进行多字段排序

Python3 的 sorted 函数相信你们都会,不外乎像下面这种:python >>> pairs = [('11', 'one'),('3', 'three'), ('2', 'two'),('2', 'zzz'), ('4', 'four')] >>> sorted(pairs) [('11', 'one'), ('2', 'two'), ('2', 'zzz'), ('3', 'thre
相关文章
相关标签/搜索