числа на лету.
Код: Выделить всё
def lambda_array():
# initialize an empty array
lambda_methods = []
# implement a for loop to count from 0 to 9
for i in range(10):
# append the lambda function to the array defined above
lambda_methods.append(lambda x, i=i: x + i)
return lambda_methods
print(lambdas[0](10))
Подробнее здесь: https://stackoverflow.com/questions/790 ... qual-to-19