Lets say there\'s a function func() which takes two arguments, a and b. Is there some kind of technique in Python to pass a single lis
func()
a
b
You can use * to unpack the list into arguments:
*
myfunc(*mylist)
def myfunc(a, b): return a+b mylist = [1, 2] myfunc(*mylist)
Here mylist can be list, tuple, string etc of length 2.
mylist
list
tuple
string