1. *args使用说明
def test(a,*args):
print a
print args
test(1,2,3,4)
输出:
1
(2, 3, 4)
(2, 3, 4)
2. **kwargs 使用方法
def test(a, **kwargs):
print a
print kwargs
test(1, s1='CN', s2='US', s3='EN')
输出
1
{'s3': 'EN', 's2': 'US', 's1': 'CN'}
{'s3': 'EN', 's2': 'US', 's1': 'CN'}
--end