python 进阶教程

源码

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')


def greet_me(**kwargs):
    for key, value in kwargs.items():
        print("{0} == {1}".format(key, value))

greet_me(name="yasoob")
greet_me(age="14")
kwargs = {'name':'zhangsan','age':15}
greet_

猜你喜欢

转载自blog.csdn.net/weixin_32393347/article/details/104183862