*args 的用法
def test_var_args(f_arg, *argv):
print("first normal arg:", f_arg)
for arg in argv:
print("another arg through *argv:", arg)
test_var_args('yasoob', 'python', 'eggs', 'test')first normal arg: yasoob
another arg through *argv: python
another arg through *argv: eggs
another arg through *argv: test最后更新于
这有帮助吗?