2 ms·
Ah - the answer was so simple: I'm an idiot. for i in range(3): m.append(lambda x,i=i: x+i) actually works, I just had a brain fart. :)
by dahauns 10y ago
Ah - the answer was so simple: I'm an idiot.
for i in range(3):
m.append(lambda x,i=i: x+i)
actually works, I just had a brain fart. :)