去重的几种方式python

a = [1, 2, 3, 2, 4, 1, 5]app # 转换为集合,去重 b = set(a) b = list(b) print(b)rem # 遍历,输出列表,去重 c = [] for i in a:     if i not in c:         c.append(i) print(c)遍历 # 字典方法 def removeSame3(L):     myDict = {}
相关文章
相关标签/搜索