wynemo
5/23/2013 - 9:43 AM

remove duplicate element from a list using python, you can use build-in function reduce

remove duplicate element from a list using python, you can use build-in function reduce

a = [1, 1, 2, 3]
print reduce(lambda x, y: x if y in x else x + [y], a, [])