[Tutor] lamda in list comp

Jim Mooney cybervigilante at gmail.com
Sun Mar 29 03:25:28 CEST 2015


Shouldn't this give me a list of squares?
[lambda x: x**2 for x in range(10)]

Instead I'm getting ten of these (with different addresses)
<function <listcomp>.<lambda> at 0x01262A50>]

-- 
Jim

I can't think of a clever tagline today, so just imagine I said something
clever.


More information about the Tutor mailing list