# *args and **kwargs

Using *args and **kwargs in the parameter list of your function allows it to take an arbitrary number of positional and keyword arguments.
The names args and kwargs are not special, but are used by convention.
The 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