In message <[EMAIL PROTECTED]>, Antoon Pardon wrote:
> On 2007-10-01, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>
>> En Sun, 30 Sep 2007 16:16:30 -0300, <[EMAIL PROTECTED]> escribi?:
>>
From my POV, if I want sequence from here to there, it should include
>>> both here and there.
>>>
>>> I
Gabriel Genellina wrote:
> En Sun, 30 Sep 2007 16:16:30 -0300, <[EMAIL PROTECTED]> escribi�:
>
>>> From my POV, if I want sequence from here to there, it should include
>> both here and there.
>>
>> I do understand the consequences of making high bound exclusive, which
>> is more elegant code: xra
On 2007-10-02, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Antoon Pardon <[EMAIL PROTECTED]> writes:
>
>> It may be convincing if you only consider natural numbers in
>> ascending order. Suppose you have the sequence a .. b and you want
>> the reverse. If you work with included bounds the reverse i
Antoon Pardon <[EMAIL PROTECTED]> writes:
> It may be convincing if you only consider natural numbers in
> ascending order. Suppose you have the sequence a .. b and you want
> the reverse. If you work with included bounds the reverse is just b
> .. a. If you use the python convention, things beco
On 2007-10-01, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Sun, 30 Sep 2007 16:16:30 -0300, <[EMAIL PROTECTED]> escribi?:
>
>>> From my POV, if I want sequence from here to there, it should include
>> both here and there.
>>
>> I do understand the consequences of making high bound exclusive,
En Sun, 30 Sep 2007 16:16:30 -0300, <[EMAIL PROTECTED]> escribi�:
>> From my POV, if I want sequence from here to there, it should include
> both here and there.
>
> I do understand the consequences of making high bound exclusive, which
> is more elegant code: xrange(len(c)). But it does seem a bi
On Sep 30, 8:16 pm, [EMAIL PROTECTED] wrote:
> > > c=' abcde abc cba fdsa bcd '.split()
> > > dels='ce '
> > > for j in dels:
> > >cp=[]
> > >for i in xrange(0,len(c)-1):
>
> > The "-1" looks like a bug; remember in Python 'stop' bounds
> > are exclusive. The indexes of c are simply xran
> > c=' abcde abc cba fdsa bcd '.split()
> > dels='ce '
> > for j in dels:
> >cp=[]
> >for i in xrange(0,len(c)-1):
>
> The "-1" looks like a bug; remember in Python 'stop' bounds
> are exclusive. The indexes of c are simply xrange(len(c)).
Yep. Just found it out, though this seems a bi
On 30 Wrz, 20:27, William James <[EMAIL PROTECTED]> wrote:
> On Sep 30, 8:53 am, [EMAIL PROTECTED] wrote:
> E:\Ruby>irb
> irb(main):001:0> ' abcde abc cba fdsa bcd '.split(/[ce ]/)
> => ["", "ab", "d", "", "ab", "", "", "ba", "fdsa", "b", "d"]
That's acceptable only if you write perfect ruby-to-p
> > ['ab', 'd', '', 'ab', '', '']
>
> Given your original string, I'm not sure how that would be the
> expected result of "split c on the characters in dels".
Oops, the inner loop should be:
for i in xrange(0,len(c)):
Now it works.
> >>> c=' abcde abc cba fdsa bcd '
> >>> import re
> >>
On Sep 30, 8:53 am, [EMAIL PROTECTED] wrote:
> Hello everyone,
>
> OK, so I want to split a string c into words using several different
> separators from a list (dels).
>
> I can do this the following C-like way:
>
> >>> c=' abcde abc cba fdsa bcd '.split()
> >>> dels='ce '
> >>> for j in dels:
>
>
[EMAIL PROTECTED] wrote:
> Hello everyone,
>
> OK, so I want to split a string c into words using several different
> separators from a list (dels).
>
> I can do this the following C-like way:
>
> c=' abcde abc cba fdsa bcd '.split()
> dels='ce '
> for j in dels:
> cp=[]
> for i i
> OK, so I want to split a string c into words using several different
> separators from a list (dels).
>
> I can do this the following C-like way:
>
c=' abcde abc cba fdsa bcd '.split()
dels='ce '
for j in dels:
> cp=[]
> for i in xrange(0,len(c)-1):
> cp
On 9/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> OK, so I want to split a string c into words using several different
> separators from a list (dels).
Have a look at this recipe:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303342
which contains several w
On 9/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> OK, so I want to split a string c into words using several different
> separators from a list (dels).
Have a look at this recipe:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303342
which contains several w
Hello everyone,
OK, so I want to split a string c into words using several different
separators from a list (dels).
I can do this the following C-like way:
>>> c=' abcde abc cba fdsa bcd '.split()
>>> dels='ce '
>>> for j in dels:
cp=[]
for i in xrange(0,len(c)-1):
16 matches
Mail list logo