*args:在不确定参数量时可以传递任意数量的参数。
def convert_args(*args): for index, name in enumerate(args): print'{0}: {1}'.format(index+1, name) convert_args('xz','yibo','bx')
**kwargs:允许没有预先定义的参数名。
def convert_kwargs(**kwargs): for name, property in kwargs.items(): print '{0} = {1}'.format(name, property) convert_kwargs(xz = 'tender', yibo = 'cool')