Comment on A (deceptively tricky?) Python questionComments−aviv16yTry 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)]−fragmede16y(requires python2.6 - http://docs.python.org/library/itertools.html#itertools.prod... )−noaharcOP16yMany thanks! I'm using it now.
Comments
Try this for when you need to fill 2 blank tiles:
(requires python2.6 - http://docs.python.org/library/itertools.html#itertools.prod... )
Many thanks! I'm using it now.