Flattening lists

Tobiah toby at tobiah.org
Thu Feb 5 20:06:39 CET 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