[Tutor] Flattening multi-dimentional list

Bernard Lebel 3dbernard at gmail.com
Thu Sep 29 03:23:40 CEST 2005


Thanks a lot Danny.


Bernard



On 9/28/05, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
>
>
> On Wed, 28 Sep 2005, Bernard Lebel wrote:
>
> > I have this list wich is made of tuples. I wish I could "flatten" this
> > list, that is, to extract each element in the tuples and build a new
> > flat list with it. Is there any shortcut to do that or do I have to go
> > through some list comprehension-like procedure?
>
> Here you go:
>
>     http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/363051
>
> Hope this helps!
>
>


More information about the Tutor mailing list