4 ms·
Yeah, that part stood out to me as well. The only way I've found to get different values for each of the functions is to use a different closure for each funct
by MereInterest 13y ago
Yeah, that part stood out to me as well. The only way I've found to get different values for each of the functions is to use a different closure for each functions.
funcs = [(lambda i: (lambda :i))(n) for n in range(3)]
for f in funcs:
print(f())