I need to generate a list of triplets containing only uppercase English letters:
["AAA","AAB","AAC", ..., 'ZZZ']
What is the fastest way to do this in python?
>>> from itertools import product
>>> from string import ascii_uppercase
>>> triplets = map(''.join, product(ascii_uppercase, repeat=3))
>>> triplets[4]
'AAE'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With