after sorted from the lists

jepler at unpythonic.net jepler at unpythonic.net
Tue Nov 22 10:29:49 EST 2005


>>> ll = [[1,2],[2,1],[3,1],[1,4],[3,3],[1,4]]
>>> ls = [frozenset(i) for i in ll]
>>> ss = set(ls)
>>> ss
set([frozenset([1, 3]), frozenset([1, 2]), frozenset([1, 4]), frozenset([3])])
>>> [list(i) for i in ss]
[[1, 3], [1, 2], [1, 4], [3]]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051122/9ca9e4a9/attachment.sig>


More information about the Python-list mailing list