python面试题之Python代码实现删除一个list里面的重复元素
程序员文章站
2022-04-14 18:48:13
>>> l = [1,1,2,3,4,5,4] >>> list(set(l)) [1, 2, 3, 4, 5] 或者 d = {} for x in mylist: d[x] = 1 mylist = list(d.keys()) >>> l = [1,1,2,3,4,5,4] >>> list( ......
>>> l = [1,1,2,3,4,5,4] >>> list(set(l)) [1, 2, 3, 4, 5] 或者 d = {} for x in mylist: d[x] = 1 mylist = list(d.keys())
所属网站分类: 面试经典 > python
作者:外星人入侵
原文链接:
来源:python黑洞网