flattening and rebuilding a simple list of lists

2009-11-30 Thread Esmail
Hi, I have a list of lists. The number of sublists may vary. The sizes of the sublists may also vary. For instance, here I have a list with 3 sublists of differing sizes. [['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h', 'i']] This list will never be any deeper than this one level. What I would

Re: flattening and rebuilding a simple list of lists

2009-11-30 Thread Peter Otten
Esmail wrote: Hi, I have a list of lists. The number of sublists may vary. The sizes of the sublists may also vary. For instance, here I have a list with 3 sublists of differing sizes. [['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h', 'i']] This list will never be any deeper than this

Re: flattening and rebuilding a simple list of lists

2009-11-30 Thread Neil Cerutti
On 2009-11-30, Esmail ebo...@hotmail.com wrote: I have a list of lists. The number of sublists may vary. The sizes of the sublists may also vary. For instance, here I have a list with 3 sublists of differing sizes. [['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h', 'i']] This list will never

Re: flattening and rebuilding a simple list of lists

2009-11-30 Thread Esmail
Ok, well I'm glad no one threw up their hands in horror to the code I posted. I'll have to study the alternate solutions offered (thanks!) Esmail -- http://mail.python.org/mailman/listinfo/python-list