摘要: python默认提供的列表sort方法,仅支持列表的元素排序。若想实现结构提排序,可参考下面方法: 1、使用 lambda 表达式 1 class struct: 2 def __init__ (self): 3 self.a = 0 4 self.b = 'a' 5 6 struct_list = 阅读全文
posted @ 2023-09-12 21:16 King--jin 阅读(260) 评论(0) 推荐(0)