【发布时间】:2016-02-16 08:53:56
【问题描述】:
当我调用函数时,python 是否支持动态参数传递?
import itertools.product
l = [1,2,3,95,5]
for i in range(5):
for n in itertools.product(l,l):
#calculations that
#reduce set size
我希望通过 i 产品的迭代:
i=1: 产品(l,l)
i=2: 产品(l,l,l)
i=3: 产品(l,l,l,l)
...
如果我没记错的话,我所知道的唯一支持这种功能的语言是 PHP。
【问题讨论】:
标签: python python-3.x arguments parameter-passing