James Stroud a écrit :
> SuperHik wrote:
>
>> and the winner is... :D
>> David Isaac wrote:
>>
>>> alpha = string.lowercase
>>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>
>>
>>
>>
>
> Not necessarily vying for winner, but David's solution is highly
> specific as it doesn't do so w
John Machin a écrit :
> On 10/06/2006 7:49 AM, Rob Cowie wrote:
(snip)
>>
>> def generator():
>> for char in alpha:
>
>
> Why stop at two spaces? One-space indentation is syntactically correct :-)
I very often uses 2-spaces indent when posting here, to avoid problems
with wrapping.
--
http:
sam wrote:
> I have found that the more elegant the code is, the harder it is for me
> to understand what it is trying to accomplish. It is my opinion that
> "Keep It Simple" wins over elegance. When I have had the urge to get
> elegant, I make sure I comment the elegance so my less elegant
> co-wo
I have found that the more elegant the code is, the harder it is for me
to understand what it is trying to accomplish. It is my opinion that
"Keep It Simple" wins over elegance. When I have had the urge to get
elegant, I make sure I comment the elegance so my less elegant
co-workers can figure out
Fredrik Lundh wrote:
> James Stroud wrote:
>
>> See the actual question:
>>
>> >How would you construct a generator to acheive this?
>
>
> if you don't think the context provided by the subject line and the
> sentence before the question is important, how come you're so sure what
> "this" ref
James Stroud wrote:
> See the actual question:
>
> >How would you construct a generator to acheive this?
if you don't think the context provided by the subject line and the
sentence before the question is important, how come you're so sure what
"this" refers to ?
--
http://mail.python.org
2006/6/10, SuperHik <[EMAIL PROTECTED]>:
> > Not necessarily vying for winner, but David's solution is highly
> > specific as it doesn't do so well for something like
> >
> > aaa
> >
I'm not sure if you ever got a good answer. I for one am too lazy to
look up the pages I found... but - check out
http://aspn.activestate.com/ASPN/search?query=combinations§ion=PYTHONCKBK&type=Subsection
Tons of nice recipes... Personally I liked the one that dynamically
generated a nested functi
Steve Holden wrote:
> James Stroud wrote:
>
>> SuperHik wrote:
>>
>>> and the winner is... :D
>>> David Isaac wrote:
>>>
>>>
alpha = string.lowercase
x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>>
>>>
>>>
>>>
>>
>> Not necessarily vying for winner, but David's solution is hig
James Stroud wrote:
> SuperHik wrote:
>
>> James Stroud wrote:
>>
>>> SuperHik wrote:
>>>
and the winner is... :D
David Isaac wrote:
> alpha = string.lowercase
> x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>>
>>> Not necessarily vying for
Steve Holden wrote:
> James Stroud wrote:
>
>> SuperHik wrote:
>>
>>> and the winner is... :D
>>> David Isaac wrote:
>>>
>>>
alpha = string.lowercase
x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>>
>>>
>>>
>>>
>>
>> Not necessarily vying for winner, but David's solution is hig
Steve Holden wrote:
> James Stroud wrote:
>
>> Rob Cowie wrote:
>>
>>> Hi all,
>>>
>>> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
>>> 'abb', 'abc' etc. all the way to 'zzz'.
>>>
>>> How would you construct a generator to acheive this?
>>>
>>> A simple, working but some
SuperHik wrote:
> James Stroud wrote:
>
>> SuperHik wrote:
>>
>>> and the winner is... :D
>>> David Isaac wrote:
>>>
alpha = string.lowercase
x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>>
>>>
>>>
>>>
>>
>> Not necessarily vying for winner, but David's solution is highly
>>
James Stroud wrote:
> SuperHik wrote:
>
>>and the winner is... :D
>>David Isaac wrote:
>>
>>
>>>alpha = string.lowercase
>>>x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>
>>
>>
>
> Not necessarily vying for winner, but David's solution is highly
> specific as it doesn't do so well for
James Stroud wrote:
> Rob Cowie wrote:
>
>>Hi all,
>>
>>I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
>>'abb', 'abc' etc. all the way to 'zzz'.
>>
>>How would you construct a generator to acheive this?
>>
>>A simple, working but somewhat inelegant solution is...
>>
>>alph
James Stroud wrote:
> SuperHik wrote:
>> and the winner is... :D
>> David Isaac wrote:
>>
>>> alpha = string.lowercase
>>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>
>>
>>
>
> Not necessarily vying for winner, but David's solution is highly
> specific as it doesn't do so well for s
On 10/06/2006 7:01 PM, Rob Cowie wrote:
> John Machin wrote:
>> On 10/06/2006 7:49 AM, Rob Cowie wrote:
>>> Hi all,
>>>
>>> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
>>> 'abb', 'abc' etc. all the way to 'zzz'.
>>>
>>> How would you construct a generator to acheive this
Rob Cowie wrote:
>> Why type all that punctuation?
>
> What punctuation?
['','','','']['','','','']['','','','']
(also see david isaac's post)
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> On 10/06/2006 7:49 AM, Rob Cowie wrote:
> > Hi all,
> >
> > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> > 'abb', 'abc' etc. all the way to 'zzz'.
> >
> > How would you construct a generator to acheive this?
> >
> > A simple, working but somewhat in
SuperHik wrote:
> and the winner is... :D
> David Isaac wrote:
>
>> alpha = string.lowercase
>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
>
>
>
Not necessarily vying for winner, but David's solution is highly
specific as it doesn't do so well for something like
a
and the winner is... :D
David Isaac wrote:
> alpha = string.lowercase
> x=(a+b+c for a in alpha for b in alpha for c in alpha)
--
http://mail.python.org/mailman/listinfo/python-list
Rob Cowie wrote:
> Hi all,
>
> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> 'abb', 'abc' etc. all the way to 'zzz'.
>
> How would you construct a generator to acheive this?
>
> A simple, working but somewhat inelegant solution is...
>
> alpha = ['a','b','c','d'] #sh
alpha = string.lowercase
x=(a+b+c for a in alpha for b in alpha for c in alpha)
--
http://mail.python.org/mailman/listinfo/python-list
On 10/06/2006 7:49 AM, Rob Cowie wrote:
> Hi all,
>
> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> 'abb', 'abc' etc. all the way to 'zzz'.
>
> How would you construct a generator to acheive this?
>
> A simple, working but somewhat inelegant solution is...
You're not
On 2006-06-09, Rob Cowie <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> 'abb', 'abc' etc. all the way to 'zzz'.
>
> How would you construct a generator to acheive this?
>
> A simple, working but somewhat inelegant solution is...
>
"Rob Cowie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> alpha = ['a','b','c','d'] #shortened for brevity
> alpha2 = ['a','b','c','d']
> alpha3 = ['a','b','c','d']
>
> def generator():
> for char in alpha:
> for char2 in alpha2:
> for char3 in alpha3:
> yield c
Rob Cowie wrote:
> Hi all,
>
> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> 'abb', 'abc' etc. all the way to 'zzz'.
>
> How would you construct a generator to acheive this?
>
> A simple, working but somewhat inelegant solution is...
>
> alpha = ['a','b','c','d'] #sh
Rob Cowie wrote:
> Hi all,
>
> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
> 'abb', 'abc' etc. all the way to 'zzz'.
>
> How would you construct a generator to acheive this?
>
> A simple, working but somewhat inelegant solution is...
>
> alpha = ['a','b','c','d'] #sh
Hi all,
I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba',
'abb', 'abc' etc. all the way to 'zzz'.
How would you construct a generator to acheive this?
A simple, working but somewhat inelegant solution is...
alpha = ['a','b','c','d'] #shortened for brevity
alpha2 = ['a','b'
29 matches
Mail list logo