On Sat, 2010-04-17 at 00:37 +1000, Lie Ryan wrote:
> On 04/16/10 23:41, J wrote:

> > So, what I'm curious about, is there a list comprehension or other
> > means to reduce that to a single line?
> 
> from itertools import chain
> def printout(*info):
>     print '\n'.join(map(str, chain(*info)))
> 
> or using generator comprehension
> 
> from itertools import chain
> def printout(*info):
>     print '\n'.join(str(x) for x in chain(*info))


It's even easier if you don't need to modify lista.  

    print lista + listb


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

Reply via email to