A permutation on permutations
arthur.siegel at rsmi.com
arthur.siegel at rsmi.com
Mon Nov 26 12:52:30 EST 2001
Phil writes -
>BTW, if you change the 1st if statment to
> if len(current) == len(source):
>you can get rid of the (done) variable.
But actually the 'done' variable is useful. By setting
'done' to 2 as an argument - if 'source'
is 6 elements, I get back a list of the 4 element
permutations of the 6 elements - excluding reversals as
dups, of course.
Happens to be useful functionality for what I'm
playing with.
Thanks again.
Art
More information about the Python-list
mailing list