可变参数*arges
实例1
def person_info(*args):
for i in args:
ret1=sum(args)
n=len(args)
ret2=ret1/n
print(ret2)
*arges为不定长参数,参数可以是多个
person_info(1,2,4,5,6,7,8,9,11,12)
实例2
def person_info(*args):
print(args)
for i in args:
print(i)
这是传入一个字典为参数
person_info({'name':'xu','gae':19})