help with code for combinations/permutations

Andreas Jung andreas at andreas-jung.com
Wed Jan 17 11:06:50 EST 2001


On Wed, Jan 17, 2001 at 03:32:46PM +0000, Hans Nowak wrote:
> Bryan Webb wrote:
> 
>   http://tor.dhs.org/~zephyrfalcon/snippets/source/338.py

This code looks fine. However one should keep in mind that for a set of n elements
you have n! permutations. For a k-permutation you have n!/(n-k)! permutations.
So your result set might become very large :-)

Andreas




More information about the Python-list mailing list