Or equivalently, to pass multiple arguments to a called function?
So I am trying to do:
- define a function
fun1 - define another function
fun2, which will callfun1but only assigning some values tofun1, with other values being assigned otherwise; or maybe I can assign multiple arguments to a called function?
def fun1(x, y):
return x*y
def fun2(fun, x):
print(fun(x))
fun2(fun1(y=2), 3) # doesn't work
fun2(fun1, (3, 2)) # doesn't work either
So how should I do this? I want fun2 to just print fun1's result with some variable for x (here I choose it to be 3) and assigned(fixed) y=2