| 1 | initial version |
Yet "an other" possibility, we use the sage specific Combinations. For instance:
sage: S = [1, 2, 3, 5]
sage: Combinations(S, 2)
Combinations of [1, 2, 3, 5] of length 2
sage: for A in Combinations(S, 2):
....: print(A)
....:
[1, 2]
[1, 3]
[1, 5]
[2, 3]
[2, 5]
[3, 5]
sage:
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.