Python Code Snippets
rzantow at ntelos.net
Fri Jul 4 02:13:01 CEST 2003
Behrang Dadsetan wrote:
> Guyon Morée wrote:
>> You're gonna love this :)
>> "Aurélien Géron" <ageron at HOHOHOHOvideotron.ca> wrote in message
>> news:be1hs0$111s$1 at biggoron.nerim.net...
>>> Does anyone know where I can find a lot of Python code snippets?
> Or you might want to just look around here. In this
> newsgroup/mailing-list one gets to see really lots of nice code.
> One that I would nominate as the best test for measuring a hard-core
> python programmer would be to explain the following code without the
> context :)
> Karl Scalet wrote:
> > there are very likely easier ways, but at least
> > s = 'C6 H12 O6'
> > print [' '.join(xx) for xx in apply(
> > zip,[(x,x[1:]) for x in s.split()])]
> > gives some results,
> > Karl
> Once I understood the above, I beleive I will write python in my
> What was this about "One simple obvious way doing it"? ;)
Obviously, this is just what people mean by "syntactic sugar."
More information about the Python-list