I have a function that takes a variable amount of variables as arguments. How would I the contents of some_list
in the example below to my myfunc2()
def myfunc1(*args):
arguments = [i for i in args]
#doing some processing with arguments...
some_list = [1,2,3,4,5] # length of list depends on what was passed as *args
var = myfunc2(???)
The only way I can think of is to pass a list or tuple to myfunc2()
as argument, but maybe there is a more elegant solution so I don't have to rewrite myfunc2()
and several other functions.