我需要生成一个只包含大写英文字母的三元组列表:
["AAA","AAB","AAC", ..., 'ZZZ']在python中做这件事最快的方法是什么?
发布于 2013-06-10 16:47:33
>>> from itertools import product
>>> from string import ascii_uppercase
>>> triplets = map(''.join, product(ascii_uppercase, repeat=3))
>>> triplets[4]
'AAE'https://stackoverflow.com/questions/17020008
复制相似问题