On May 17, 1:28 am, a...@pythoncraft.com (Aahz) wrote:
> In article
> <180531ca-33aa-47b9-9c69-5b5973f6b...@v35g2000pro.googlegroups.com>,
> John Machin wrote:
> >Neat trick. However, from 2.6.2:
>
> help(sum)
> >Help on built-in function sum in module __builtin__:
>
> >sum(...)
> > sum(
> Since when is a list a number? Perhaps the help needs clarification,
> in line with the docs.
Everyone is supposed to use reduce() here ;)
Kay
--
http://mail.python.org/mailman/listinfo/python-list
In article <180531ca-33aa-47b9-9c69-5b5973f6b...@v35g2000pro.googlegroups.com>,
John Machin wrote:
>
>Neat trick. However, from 2.6.2:
>
help(sum)
>Help on built-in function sum in module __builtin__:
>
>sum(...)
>sum(sequence[, start]) -> value
>
>Returns the sum of a sequence of nu
On Fri, 15 May 2009 17:12:24 +0100, wrote:
How do you parse a string enclosed in Curly Braces?
For instance:
x = "{ABC EFG IJK LMN OPQ}"
I want to do x.split('{} ') and it does not work. Why does it not work
and what are EXCEPTIONS to using the split method?
Other people have already done
On May 16, 3:25 am, MRAB wrote:
> Chris Rebert wrote:
> > On Fri, May 15, 2009 at 9:12 AM, wrote:
> >> How do you parse a string enclosed in Curly Braces?
>
> >> For instance:
>
> >> x = "{ABC EFG IJK LMN OPQ}"
>
> >> I want to do x.split('{} ') and it does not work. Why does it not work
> >> an
k...@fiber-space.de wrote:
> ttable = string.maketrans("{} ", "\1\1\1")
> print x.translate(ttable).split("\1") # -> ['', 'ABC', 'EFG', 'IJK',
> 'LMN', 'OPQ', '']
>
> The validity of the translation+split depends on the presence of \1 in
> the original string of course.
Keep one of the split
On 15 Mai, 18:12, xama...@yahoo.com wrote:
> How do you parse a string enclosed in Curly Braces?
>
> For instance:
>
> x = "{ABC EFG IJK LMN OPQ}"
>
> I want to do x.split('{} ') and it does not work. Why does it not work
> and what are EXCEPTIONS to using the split method?
>
> That I want to split
Chris Rebert wrote:
On Fri, May 15, 2009 at 9:12 AM, wrote:
How do you parse a string enclosed in Curly Braces?
For instance:
x = "{ABC EFG IJK LMN OPQ}"
I want to do x.split('{} ') and it does not work. Why does it not work
and what are EXCEPTIONS to using the split method?
.split() take
On May 15, 11:12 am, xama...@yahoo.com wrote:
> How do you parse a string enclosed in Curly Braces?
>
> For instance:
>
> x = "{ABC EFG IJK LMN OPQ}"
>
> I want to do x.split('{} ') and it does not work. Why does it not work
> and what are EXCEPTIONS to using the split method?
>
> That I want to sp
On Fri, May 15, 2009 at 9:12 AM, wrote:
> How do you parse a string enclosed in Curly Braces?
>
> For instance:
>
> x = "{ABC EFG IJK LMN OPQ}"
>
> I want to do x.split('{} ') and it does not work. Why does it not work
> and what are EXCEPTIONS to using the split method?
.split() takes a *substr
10 matches
Mail list logo