Imagine this situation:
def foo1(item1, item2, item3):
pass
def foo2(item4, item5):
pass
item_to_pass = "random item"
x = 3
I need to call one of the functions which takes x arguments. As parameters, I want to pass item_to_pass (or any other variable).
Basically, I know how to find out how many parameters does a function have using inspect module. But what I don't know is how to call a certain function with those arguments (let's say those arguments are all the same). Also note that I can not pass a list of items as an argument instead of multiple parameters, I need to have different amount of arguments and based on that call the function.
Do you have any idea, how could I solve this?