The following code works, however, I also want the currently commented line "perform(action1)" to work -- which would work if I comment-toggle line 3-4. This in turns, would stop the last line from working.
def perform(f):
a = "A"
#f()
f(a)
def action1():
print("No arg")
def action2(a):
print(a)
#perform(action1)
perform(lambda a: action2(a=a))
I want function "perform" to receive functions as parameters that have a varying amount of parameters whose values are only assigned within "perform" and not known before.