Oh my, that's awful. Even in python there are better ways to close over a value :)
I haven't written python in many years, but in the following example it is at least clear what is going on:
def make_printer(n):
def printer():
print(n)
return printer
[make_printer(i) for i in range(2)]
Here's a stupid example. Notice in the first case printing i doesn't grab the value of i when the lambda is defined. The second case is likely what you want.