Joh wrote:
hello,
i'm trying to understand how i could build following consecutive sets from a root one using generator :
l = [1,2,3,4]
would like to produce :
[1,2], [2,3], [3,4], [1,2,3], [2,3,4]
Do you mean:
[1,2], [2,3], [3,4], [1,2,3], [2,3,4], [1,3,4]
(E.g. all elements in the power set except the empty set, the sets with one element and the sets with all elements.)
Otherwise, please describe your desired sets in verbal - I cannot see the point.
-- http://mail.python.org/mailman/listinfo/python-list