好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

python逆向参数收集是什么

说明

1、逆向参数收集,即直接将列表,元组,字典作为函数参数。不过调用函数时要对实参加上*号。

2、即使是支持收集的参数,如果程序需要将一个元组传输元组,也需要使用逆向收集。

实例

def param_test(name, age):
    print('name=', name)
    print('age=', age)
 
data = ['python之父', 18]
param_test(*data)

查看更多关于python逆向参数收集是什么的详细内容...

  阅读:18次