I am trying to write a higher-order function that takes a varying amount of arguments. For instance something like this
def higher(fnc, args):
print(f"Calling function {fnc}")
fnc(argv)
def one_arg(only_arg):
print(f"Here is the only arg {only}")
def two_arg(first, second):
print(f"Here is the first {first} And here is the second {second}")
higher(one_arg, "Only one argument")
higher(two_arg, "Here's one arg", "and Another one")
Is it possible to do this without changing the functions one_arg() or two_arg() ?
I've looked into using *argv but I don't think I understand it well enough or see a way to use that without changing those two functions