楼主有考虑过有多少种组合吗? 26的6次方可是个不小的数!
诚如 2楼所说的 就是循环穷举,没太多意义。
不过为了娱乐,我还是写了个,最近在学python,就用python写了个:- L=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
- ge = ("".join([a,b,c,d,e,f]) for a in L for b in L for c in L for d in L for e in L for f in L)
- with open("out.txt","wt") as out:
- for x in ge:
- out.write(x+",")
复制代码 在我的机器上3分钟才跑完,生成的文件有2GB多,建议不要轻易尝试 |