[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: counting using variable length string as base
From:       Paul Rubin <"http://phr.cx" () NOSPAM ! invalid>
Date:       2008-04-01 8:12:26
Message-ID: 7xlk3yro2d.fsf () ruckus ! brouhaha ! com
[Download RAW message or body]

Grimsqueaker <Grimsqueaker13@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.
-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic