counting using variable length string as base

Paul Rubin http
Tue Apr 1 04:12:26 EDT 2008


Grimsqueaker <Grimsqueaker13 at gmail.com> writes:
> Basically I want to find every possible order of every combination.
> Its easy if you know how many characters there will be in your string
> (use nested for loops), but I am stuck with the variable length
> string. I think I have to use a generator but I'm not sure exactly how.
> 
> Can anyone give me a pointer in the right direction?

The basic idea is to use recursion to get the effect of nested for loops
except to an arbitrary depth.  You don't need a generator.



More information about the Python-list mailing list