python 关键参数和默认值

def hello_key(greeting='hello', name='world'):
    print('%s, %s' % (greeting, name))

hello_key()
hello_key(greeting='panzidong')

result:

hello, world
panzidong, world

关键参数的厉害地方在于可以在函数中提供默认参数

原文地址:https://www.cnblogs.com/lianghong881018/p/11080896.html