python 列表去重 保持顺序

l1 = ['b','c','d','b','c','a','a']
l2 = []
[l2.append(i) for i in l1 if not i in l2]
print l2

猜你喜欢

转载自blog.csdn.net/x1131230123/article/details/113519907