C
christof hoeke
hello,
this must have come up before, so i am already sorry for asking but a
quick googling did not give me any answer.
i have a list from which i want a simpler list without the duplicates
an easy but somehow contrived solution would be
there should be an easier or more intuitive solution, maybe with a list
comprehension=
somthing like
does not work though.
thanks for any help
chris
this must have come up before, so i am already sorry for asking but a
quick googling did not give me any answer.
i have a list from which i want a simpler list without the duplicates
an easy but somehow contrived solution would be
[1, 2, 3]>>> a = [1, 2, 2, 3]
>>> d = {}.fromkeys(a)
>>> b = d.keys()
>>> print b
there should be an easier or more intuitive solution, maybe with a list
comprehension=
somthing like
[]>>> b = [x for x in a if x not in b]
>>> print b
does not work though.
thanks for any help
chris