标签:tool 根据 author word tools class lan 组合 alt
#_*_ coding:utf-8 _*_
#__author__=‘dragon‘
import itertools
list1 = [1,2,3,4,5]
list2 = []
for i in range(1,len(list1)+1):
iter = itertools.combinations(list1,i)
list2.append(list(iter))
print(list2)
#_*_ coding:utf-8 _*_
#__author__=‘dragon‘
import itertools
list1 = [1,2,3,4,5]
list2 = []
for i in range(1,len(list1)+1):
iter = itertools.permutations(list1,i)
list2.append(list(iter))
print(list2)
标签:tool 根据 author word tools class lan 组合 alt
原文地址:http://www.cnblogs.com/smuxiaolei/p/7460619.html