Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Tim Roberts
"Gabriel F. Alcober" <[EMAIL PROTECTED]> wrote: > >Hi! There goes a newbie trouble: > >for i in range(0, len(subject)): >if subject[i] in preps: >psubject.append(noun_syn_parser(subject[0:i])) >subject[0:i] = [] > >Since the last line eliminates some elements of the

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Bengt Richter
On Thu, 24 Mar 2005 02:48:28 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" <[EMAIL PROTECTED]> >wrote: > >>Hi! There goes a newbie trouble: >> >>for i in range(0, len(subject)): >>if subject[i] in preps: >>psubject.appe

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Ron
On Thu, 24 Mar 2005 03:42:04 GMT, Ron <[EMAIL PROTECTED]> wrote: >On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" ><[EMAIL PROTECTED]> wrote: > >>Hi! There goes a newbie trouble: >> >>for i in range(0, len(subject)): >>if subject[i] in preps: >>psubject.append(noun_syn

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Ron
On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" <[EMAIL PROTECTED]> wrote: >Hi! There goes a newbie trouble: > >for i in range(0, len(subject)): >if subject[i] in preps: >psubject.append(noun_syn_parser(subject[0:i])) >subject[0:i] = [] > >Since the last li

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Bengt Richter wrote: On Thu, 24 Mar 2005 02:48:28 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" <[EMAIL PROTECTED]> wrote: Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psub

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Bengt Richter
On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" <[EMAIL PROTECTED]> wrote: >Hi! There goes a newbie trouble: > >for i in range(0, len(subject)): >if subject[i] in preps: >psubject.append(noun_syn_parser(subject[0:i])) >subject[0:i] = [] > Perhaps (untested

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Mitja
On Wed, 23 Mar 2005 23:27:54 +0100, Gabriel F. Alcober <[EMAIL PROTECTED]> wrote: Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] Since the last line elimina

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Uh! I've not even thought in using a while... Thanks! Lonnie Princehouse wrote: i = 0 while i < len(subject): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] i = 0 else: i += 1 Gabriel F. Alcober wrote: Hi! There goes a newbie trouble: for i

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Lonnie Princehouse
i = 0 while i < len(subject): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] i = 0 else: i += 1 Gabriel F. Alcober wrote: > Hi! There goes a newbie trouble: > > for i in range(0, len(subject)): > if subject[i] in preps: >

Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] Since the last line eliminates some elements of the list, I'm wondering if it's somehow possible to change the val