如果要将参数列表传递给函数,可以使用
*splat运算符。运作方式如下:
list = [1, 2, 3]function_that_takes_3_arguments(*list)
a, b, c = list # a=1, b=2, c=3
欢迎分享,转载请注明来源:内存溢出
如果要将参数列表传递给函数,可以使用
*splat运算符。运作方式如下:
list = [1, 2, 3]function_that_takes_3_arguments(*list)
a, b, c = list # a=1, b=2, c=3
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)