Try this for when you need to fill 2 blank tiles: import string from itertools import product w = "H_LL_" w_fmt = w.replace('_', '%s') product_args = [list(string.uppercase)] * 2 expanded = [w_fmt % repl for repl in product(*product_args)]
Many thanks! I'm using it now.