do you master list comprehensions?

Max M maxm at mxm.dk
Tue Dec 14 00:41:36 CET 2004


Fredrik Lundh wrote:
> Max M wrote:
> 
> 
>>>I tried funnies like [[w for w in L] for L in data],
>>
>>That is absolutely correct. It's not a funnie at all.
> 
> well, syntactically correct or not, it doesn't do what he want...

Doh! *I* might not be used to list comprehensions then... You are right.

That example could have been expressed more clearly as:

     result = data

;-)

-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Python-list mailing list