Flattening lists

Tobiah toby at tobiah.org
Thu Feb 5 14:06:39 EST 2009


> Hello everybody,
> 
> Any better solution than this?

a = [1, 2, 3, [4, 5, 6], [[7, 8], [9, 10]]]
print str(a).replace('[', '').replace(']', '').split(', ')

;)





More information about the Python-list mailing list