On Tue, Apr 12, 2005 at 08:41:15AM -0400, Bill Mill wrote:
> On Apr 12, 2005 2:37 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> > "Bernard A." wrote:
> >
> > > i'm looking for a way to have all possible length fixed n-uples from a
> > > list, i think generators can help, but was not able to do it
Bill Mill wrote:
On Apr 12, 2005 2:37 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
"Bernard A." wrote:
i'm looking ... to have all possible length fixed n-uples from a list...
... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465
And, while I'm asking that question, is there a good ref
On Apr 12, 2005 2:37 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> "Bernard A." wrote:
>
> > i'm looking for a way to have all possible length fixed n-uples from a
> > list, i think generators can help, but was not able to do it myself,
> > maybe some one could point me out to an idea to do it ?
"Bernard A." wrote:
> i'm looking for a way to have all possible length fixed n-uples from a
> list, i think generators can help, but was not able to do it myself,
> maybe some one could point me out to an idea to do it ?
did you try googling for "python permutations" ?
here's the first hit:
hello,
i'm looking for a way to have all possible length fixed n-uples from a
list, i think generators can help, but was not able to do it myself,
maybe some one could point me out to an idea to do it ?
for example, from :
l = [0, 1, 2, 3, 4]
and searching for n-uples of 3, i should produce :
(