simple recursion help
Alex Martelli
aleaxit at yahoo.com
Sat Oct 23 17:40:35 EDT 2004
Steven Bethard <steven.bethard at gmail.com> wrote:
> drs <drs <at> remove-to-send-mail-ecpsoftware.com> writes:
> >
> > I am looking for a list of all unique strings of length x whose
> > elements are from the set a, b, and c.
>
> Does anyone know what this operation is called? It's not permutations or
> combinations as I understand them since permutations and combinations do
> not allow repetition. I assume there was already a solution for this
> somewhere, but I didn't know what term to google for.
There's been a recent thread where the OP called them 'permutations',
somebody commented they're 'variations'. In that thread you'll find a
bazillion solutions, recursive and non, with or without itertools, &c.
Alex
More information about the Python-list
mailing list