Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # unique_seq.py -- for python 2.x
- unique_seq = lambda u: sorted(set(u), key=lambda s: u.index(s))
- print unique_seq([4, 2, 1, 0, 1, 3, 2])
- print unique_seq([3, 1, 4, 0, 1, 2, 4]) # double check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement