I use a function that gets some input from the user interactively and returns some values. I'd like to run the function (without changing it) without having to type in the values myself, e.g. have it read from a list. How can I achieve this?
MCVE:
def add():
a = int(input('first number: '))
b = int(input('first number: '))
return(a+b)
And I want to be able to run something like magic(add(), [2, 3])
to get the output 5
.