python 去重

#去重
a=[1,2,3,4,5,6,1,2,4]
b=[]
for i in a:
if i not in b:#判断b在不在a里面
b.append(i)
print(b)
posted @ 2020-03-11 23:00  名狐1993  阅读(177)  评论(0)    收藏  举报