4 ms·
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_
by aviv 16y ago
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)]