摘要: 1 l = [1,1,2,3,4,5,4] 2 #第一种方法,采用集合 3 print(list(set(l))) 4 5 #第二种方法采用排序 6 d = [] 7 t = sorted(l) 8 i = 0 9 while i < len(t): 10 if t[i] not in d: 11 d.append(t[i]) 12 else:... 阅读全文
posted @ 2018-07-10 10:36 暮色森森 阅读(127) 评论(0) 推荐(0) 编辑