J
Juan Pablo Romero Méndez
Hello,
Suppose this function is given:
def f(x,y):
return x+y+k
Is it possible to somehow assign a value to k without resorting to
making k global?
I'm thinking something like this:
eval("f(1,1)", {"f":f, "k":1})
Or even better, something like:
def g(k):
return f
g(1)(1,1) ==> 3
Regards,
Juan Pablo
Suppose this function is given:
def f(x,y):
return x+y+k
Is it possible to somehow assign a value to k without resorting to
making k global?
I'm thinking something like this:
eval("f(1,1)", {"f":f, "k":1})
Or even better, something like:
def g(k):
return f
g(1)(1,1) ==> 3
Regards,
Juan Pablo