用集合的天然去重
list1=[11,22,33,44,33,22] list2=list(set(list1)) print(list2) #[33, 11, 44, 22]
用字典的key
a=[12,3,3,3,44,44,22] d={} b=d.fromkeys(a) c=list(b.keys()) print(c) #[12, 3, 44, 22]