On Wed, Mar 27, 2013 at 10:11 PM, Shane Green shane@umbrellacode.comwrote:
[seen.added(value) for value in sequence if value not in seen] *
Here's an easy way to do it:
seen = set() seq = [3,2,1,2,3,4,5,4] [seen.add(v) or v for v in seq if v not in seen]
[3, 2, 1, 4, 5]
seen
{1, 2, 3, 4, 5}
--- Bruce Latest blog post: Alice's Puzzle Page http://www.vroospeak.com Learn how hackers think: http://j.mp/gruyere-security