Robert wrote:
given d:
d = ["soep", "reeds", "ook"]
I want it to print like
soep, reeds, ook
I've come up with :
print ("%s"+", %s"*(len(d)-1)) % tuple(d)
but this fails for d = []
any (pythonic) options for this?
Robert
--
http://mail.python.org/mailman/listinfo/python-list
================================
the old fashion way would be:
d = ["soep", "reeds", "ook"]
if len(d) > 0:
print ("%s"+", %s"*(len(d)-1)) % tuple(d)
# if d= [] then print stmnt bypassed
Steve
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list