simple recursion help

drs drs at remove-to-send-mail-ecpsoftware.com
Sat Oct 23 16:10:29 EDT 2004


"drs" <drs at remove-to-send-mail-ecpsoftware.com> wrote in message
news:Gpyed.320058$bp1.6526 at twister.nyroc.rr.com...
I didn't state what I am doing quite so clearly (or correctly), so I'll try
again.  I am looking for a list of all unique strings of length x whose
elements are from the set a, b, and c.

So, for example, in this case it would be

aaa, aab, aac, aba, abb, abc, aca, acb, acc, ... cca, ccb, ccc

but I need for the length and the number of elements to be variable.

I understand this will get out of hand very quickly for large numbers, but I
only need it for small length/numbers.

Thanks,

-d





More information about the Python-list mailing list