python删除列表重复元素

用list类的sort方法
l1 = ['b','c','d','b','c','a','a']
l2 = list(set(l1))
l2.sort(key=l1.index)
print l2

  

posted @ 2020-12-29 18:20  tigergaonotes  阅读(65)  评论(0编辑  收藏  举报