Inactive Tutor answered 05/08/19
Tutor
New to Wyzant
A single * will swallow up any remaining non-keyword arguments and pass them as a list for the function. ** will do the same thing for keyword arguments. Consider the following example
def this(*args, **kwargs):
for arg in args:
print(arg)
for key, value in kwargs.items():
print("{} = {}".format(key, value))
this(1, 2, 3 a=3, b=4, c=6)
The output of the above command will be
1
2
3
a = 3
b = 4
c = 6
This allows you to define functions that take a variable number of arguments.