I have the following python function f1
that expects up to three parameters:
def f1(a = 0, b = 0, c = 0):
return a + b + c
Now, I need to determine at runtime what parameters are passed to the function and their values.
For example, assume that the function needs to be called only with parameters a
and c
, ignoring b
.
My code could look like
dict = { 'a': 1, 'c': 3}
print(f1(dict)) # <--- this should print 4
This doesn't work, but you get the idea. Is there a way to determine dynamically what parameters are used in a function call?