I'm trying to write a function that will contain some default values, with the possibility of having some additional parameters sent in. For example, I would like something along the lines of this:
def defaultsAndArbitrary(arr, example1=True, example2=13, *modifiers):
#code
Then, I'd like to be able to call the function like so:
defaultsAndArbitrary([1,5,3,9], modifier1, modifier2)
With that call, the values for the arguments should be:
arr = [1,5,3,9]
example1 = True
example2 = 13
modifiers = (modifier1, modifier2)
There's a similar question here:
Having arbitrary number of arguments with a named default in python
But it doesn't really answer this question (at least, to my understanding). Is it even possible to do this?
Thanks.