Combinations of lists

Manuel Pégourié-Gonnard mpg at elzevir.fr
Wed Oct 3 12:20:00 EDT 2012


Steven D'Aprano scripsit :

> On Wed, 03 Oct 2012 16:26:43 +0200, Steen Lysgaard wrote:
>
>> This is achieved by the code below, this however needs to go through all
>> possible combinations (faculty of len(h)) and rule out duplicates as
>> they occur and this is too much if for example len(h) is 16.
>
> I don't understand this requirement. In the example above, you don't rule 
> out duplicates. Both 'aA' and 'bB' are duplicated. What duplicates are 
> you ruling out?
>
I think the requirement is that r[i] != r[j] as soon as i != j, if r is
the resulting list of lists. (As opposed to having r[i][j] != r[i][k] for all i
and j != k.)

-- 
Manuel Pégourié-Gonnard - http://people.math.jussieu.fr/~mpg/





More information about the Python-list mailing list