"""生成7位数的所有排列组合 """ import itertools as its words = "1234567890" all_comb = [] for n in range(7): r = its.product(words,repeat=n) for i in r: all_comb.append("".join(i)) f = open("dict.txt",'w') for s in all_comb: f.write(s + "\n") f.close()
"""生成7位数的所有排列组合 """ import itertools as its words = "1234567890" all_comb = [] for n in range(7): r = its.product(words,repeat=n) for i in r: all_comb.append("".join(i)) f = open("dict.txt",'w') for s in all_comb: f.write(s + "\n") f.close()
李兴球的博客是Python创意编程原创博客
要发表评论,您必须先登录。
发表评论