String building using join

Alexander Gattin xrgtn at yandex.ru
Mon Jan 3 06:56:12 EST 2011


Hello,

On Sun, Jan 02, 2011 at 10:11:50AM -0800, Alex
Willmer wrote:
> def prg3(l):
>     return '\n'.join([str(x) for x in l if x])

just one fix (one fix one fix one fix):
    return '\n'.join([str(x) for x in l if x is not None])

-- 
With best regards,
xrgtn



More information about the Python-list mailing list