Python:参数:

一、参数

1、固定参数

 

2、非固定参数

 ①功能:把N个关键字参数,转换成字典形式

②定义,代码如下:

def test (**kwargs):
    print(kwargs)

test(name = "jing", age = "22", hello= "yes") # 传入多个关键字参数
#{'name': 'jing', 'age': '22', 'hello': 'yes'} #输出   #多个关键字参数转换成字典

 

posted @ 2020-11-06 15:29  Jing01  阅读(64)  评论(0)    收藏  举报