help with code for combinations/permutations

Bryan Webb bww00 at amdahl.com
Wed Jan 17 13:37:44 EST 2001


Thanks to all that responded.

I wasnt as clear as I should have been. (as usual)
I really need to come up with all the possible sums of the numbers in the
list ie. 1 , sum(1 + 2), sum(1 + 2 + 3) ,sum( 1+2+4),sum( 1 + 3) and so on.

Thanks for all the help
Bryan.


Bryan Webb wrote in message <944adl$2bf at dispatch.concentric.net>...
>HI,
>    I have a list with 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 in it,
>I need to come up with all possible combinations of the numbers in the
above
>list ie. 1 +2, 1+2+3, 1+2+3+4, 1+2+3+4+5 and so on.
> I will have multiple lists to deal with, larger and smaller.
>Any help or ideas will be appreciated
>
>Thanks
>Bryan Webb
>
>





More information about the Python-list mailing list