列表去重后按原来顺序排序 代码实现 代码实现 代码行 list1 = [1,3,3,3,4,4,2,5,2,3,5] list2 = list(set(list1)) list2.sort(key=list1.index) print(list2) 输出结果 [1,3,4,2,5]