请写出一段Python代码实现删除一个list里面的重复元素

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())
posted @ 2020-12-31 17:09  QC_der  阅读(218)  评论(0编辑  收藏  举报
返回顶端