I have a function foo
that takes 2 arguments a
and b
. I want to create a list of functions that are similar to foo
, but value of a
is fixed.
def foo(a,b):
return a*b
fooList = []
for i in range(n):
fooList.append(foo(i))
I want fooList[i]
to return a function that is similar to foo(i, b)
.