python中非关键字可变长参数和关键字变量参数的区别

#非关键字可变长参数

def add(*arg):
    return type(arg)

print add()

#打印结果

<type 'tuple'>

#关键字变量参数

def abd(**args):
    return type(args)

print abd()

#打印结果

<type 'dict'>

由此,非关键字可变长参数是元组类型,关键字变量参数是字典类型

原文地址:https://www.cnblogs.com/listening/p/5878908.html