**kwargs in the parameter list of your function allows it to take an arbitrary number of positional and keyword arguments.
kwargs are not special, but are used by convention.
args are made available to the function as a tuple, while the
kwargs are a dictionary.
def func(*args, **kwargs): for arg in args: print arg for key, value in kwargs.iteritems(): print key, value def main(): func(1, 2, 3, apples='red', violets='blue') if __name__ == '__main__': main()
1 2 3 apples red violets blue
Reference: Arbitrary Argument Lists