How would I take a string and replace all occurrences of a given character with all possible combinations of a list of characters?

e.g. string = "GPxLEKxLExx", replace x with ['A','B','C','D','E','F']

Such that it returns:

GPALEKALEAA
GPBLEKALEAA
GPBLEKBLEAA
...
GPFLEKALEAA
...
GPFLEKFLEFF

and all other combinations of these characters.

Based on one of the answers below, this is what worked for me:

```
from itertools import product

input_str = 'GPxLEKxLExx'
input_str = input_str.replace('x', '{}')

outputs = []
for comb in product('ABCDEF', repeat=4):
    outputs.append(input_str.format(*comb))

```