Python入门.参数传递

def func(*args):#传参(元组)
    print args
    print type(args)

func(1, 2, 2, 33)
func('12', 'qw')



def func2(**args):#传参(字典)
    print args
    print type(args)

func2(a='dick', a2=2, a3=3, a4='1234qwer')

相关推荐