def test_position_arg(arg1, arg2):
# 位置参数
print arg1, arg2
def test_key_arg(arg1=1, arg2=2):
# 关键字参数
print arg1, arg2
def test(arg1, arg2=2):
# arg2是默认参数
print arg1, arg2
# 两种调用方式都可以
test(1, 2)
test(arg2=22, arg1=11)
输出结果:
1 2
11 22
[Finished in 0.4s]



