1 >>> l = [1,1,2,3,4,5,4] 2 >>> list(set(l)) 3 [1, 2, 3, 4, 5] 4 或者 5 d = {} 6 for x in mylist: 7 d[x] = 1 8 mylist = list(d.keys())