On Tue, 15 Aug 2006 19:49:17 -0700, John Machin wrote:

> Ugliness is in the eye of the beholder.
> It is more blessed to add than to multiply.
> Gaze upon this alternative:
> 
> def printitems2(sequence, count=5):
>     """Print count items of sequence per line."""
>     for pos in range(0, len(sequence), count):
>         for item in sequence[pos:pos+count]:
>             print item,
>         print


You know, that's so obvious that I've just slapped myself for not thinking
of it first. What *was* I thinking???


-- 
Steven D'Aprano 

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to