python 列表去重


list=[1, 2, 3, 4,'a','b','c','a',2, 3, 2,"b",'c','d','e','f','d']

# s = set(list)#用set方法
# print(s)
s =[]
for i in list: #列表去重
if i not in s:
s.append(i)
list = s
print(list)
posted @ 2019-08-24 17:31  未来全栈攻城狮  阅读(1426)  评论(0编辑  收藏  举报