Combining multiple sets of letters in Python
2 answers
You can use itertools.product
it to get what you want.
from itertools import product
a = ['A', 'B', 'C']
b = ['X', 'Y', 'Z']
for i in product(a, b):
print ''.join(i)
+8
source to share