A REALLY COOL PYTHON FEATURE:
Moshe Zadka
moshez at math.huji.ac.il
Thu May 11 08:30:33 EDT 2000
On Thu, 11 May 2000, Courageous wrote:
> >>> reallycool = reduce ( lambda x, y: x+", "+y, somenames )
> >>> reallycool
> 'fred, barney, wilma, betty'
How about
string.join(['Hello', 'world'], ", ")
Less code, clearer.
--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com
More information about the Python-list
mailing list