"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>>> Sometime it maybe a waste to generate all possible combinations of
>>> i,j first.
>>
>> It doesn't; read about generator expressions at
>> http://www.python.org/dev/peps/pep-0289/
>>
>> George
>>
> Thanks, I didn't realize that.
>
> However,
George Sakkis wrote:
> On Sep 29, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> [EMAIL PROTECTED] wrote:
>>
>> > On 29 sep, 12:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> >
>> >> for i in generator_a: # the first "for" cycle
>> >> for j in generator_b:
>> >>
On 29 sep, 21:38, Zentrader <[EMAIL PROTECTED]> wrote:
> ctr_a=0
> ctr_b=0
> while ctr_a < len(generator_a):
> this_el_a = generator_a[ctr_a]
> while ctr_b < len(generator_b):
> this_el_b = generator_b[ctr_ b]
> if something_happen:
> ctr_b = len(generator
On Sep 29, 8:19 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Sep 29, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > [EMAIL PROTECTED] wrote:
>
> > > On 29 sep, 12:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > >> for i in generator_a: # the first "for" cycle
On Sep 29, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] wrote:
>
> > On 29 sep, 12:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> >
> >> for i in generator_a: # the first "for" cycle
> >> for j in generator_b:
> >> if something_happen:
> >>
[EMAIL PROTECTED] wrote:
> On 29 sep, 12:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>> for i in generator_a: # the first "for" cycle
>> for j in generator_b:
>> if something_happen:
>> # do something here ..., I want the outer cycle to break
>>
On 29 sep, 12:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> for i in generator_a: # the first "for" cycle
> for j in generator_b:
> if something_happen:
> # do something here ..., I want the outer cycle to break
> break
Do you like this?
generator_
On Sep 29, 8:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
[snip]
> And I have another question. Which is the most efficient way to check if there
> are duplicate items in a list ? The items in the list may cannot be hashed, so
> set() may not work on the list.
The following classic by Ti
Ant <[EMAIL PROTECTED]> wrote:
> On Sep 29, 11:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
> ...
>> What should I do if I want the outer "for" cycle to continue or break
>> ? If I put a "continue" or "break" in the inner cycle, it has no
>> effect on the outer cycle.
>
...
> I guess
Ant wrote:
> On Sep 29, 11:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
> ...
>> What should I do if I want the outer "for" cycle to continue or break ? If I
>> put a "continue" or "break" in the inner cycle, it has no effect on the outer
>> cycle.
>
> I'd also be interested in the idi
On Sep 29, 11:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
...
> What should I do if I want the outer "for" cycle to continue or break ? If I
> put a "continue" or "break" in the inner cycle, it has no effect on the outer
> cycle.
I'd also be interested in the idiomatic solution to this o
Hi all,
I have the following code:
for i in generator_a: # the first "for" cycle
for j in generator_b:
if something_happen:
# do something here ..., I want the outer cycle to break
break
What should I do if I want the outer "for" cycle to continue or brea
12 matches
Mail list logo