A REALLY COOL PYTHON FEATURE:

Ben Wolfson rumjuggler at cryptarchy.org
Thu May 11 19:20:22 EDT 2000


On 11 May 2000 11:56:59 GMT, m.faassen at vet.uu.nl (Martijn Faassen)
wrote:

>Courageous <jkraska1 at san.rr.com> wrote:
>> reduce ( lambda x, y: x+", "+y, somenames )
>
>It's actually pretty easy in Python, too. :) (you think all this
>reducing and lambda-ing is *easy*?)
>
>import string
>string.join(["foo", "bar", "baz"], ", ")

or:

', '.join(['foo', 'bar', 'baz'])

which is much less intuitive.

-- 
Barnabas T. Rumjuggler

Then Bioy-Cesares recalled that one of the heresiarchs of Uqbar had
said that mirrors and copulation are abominable, for they both
multiply the numbers of man.
 -- Jorge Luis Borges, "Tlon, Uqbar, Orbis Tertius"



More information about the Python-list mailing list