我可以从itertools.product python返回的列表中单独列出/命名所有单个产品

时间:2014-07-22 08:12:35

标签: python-2.7 itertools

print ("Enter degree of polynomial (lowest degree = 2):")
degree = input()

print ("Enter max value of coefficient of polynomial:")
x = input() #coefficient=0,1,2,......,x
coeff = [x for x in range(0, x+1)]

for i in itertools.product(coeff,repeat=degree): #CHANGE NUMBER OF 'COEFF' ACCORDING TO DEGREE
print i

我希望能够找出返回的每个数字列表,以便我可以为另一个项目测试它们。有没有办法可以命名或识别每个数字列表?

0 个答案:

没有答案