[FRPythoneers] Joining a lists of lists?

Rob Riggs rob at pangalactic.org
Thu Aug 8 11:35:32 MDT 2002


|reduce(lambda x, y: x + y, |[[1,2,3],[4,5,6],[7,8,9]])


marciot wrote:

>Hi,
>
>I was looking for an easy way to convert a list of lists into a flattened
>list:
>
>  
>
>>>>a = somefunc([[1,2,3],[4,5,6],[7,8,9]])
>>>>print a
>>>>        
>>>>
>[1,2,3,4,5,6]
>
>In scheme, I would have written:
>
>   (apply #'append '((1 2 3) (4 5 6) (7 8 9))).
>
>What's the equivalent expression in Pythonese?
>
>While I'm at it, is there any good online reference that shows python 
>equivalents for common Scheme/LISP expressions?
>
>Marcio Luis Teixeira
>
>
>_______________________________________________
>This message sent by the FRPythoneers mailing list.
>Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
>URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
>  
>






More information about the FRPythoneers mailing list