RosettaCodeData/Task/Remove-duplicate-elements/Python/remove-duplicate-elements-3.py

4 lines
131 B
Python
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
import itertools
2013-04-10 23:57:08 -07:00
items = [1, 2, 3, 'a', 'b', 'c', 2, 3, 4, 'b', 'c', 'd']
2015-02-20 00:35:01 -05:00
unique = [k for k,g in itertools.groupby(sorted(items))]