How to replace missing characters in a string with a dictionary : <p>I want to replace missing characters in a string with a dictionary. Take <strong>t-a-19-/</strong> for example. I want to replace the dashes with every possible letter or number from an array.</p>

<p>I tried using the replace() function, but it can't take arrays. How would I do the same function but with arrays?</p>

<p>Here's my code:</p>

<pre><code>word = "t-a-19-/"

# Alpha numeric dictionary
alphanumericdict = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

# Replaces string with dictionary
brute = word.replace('-', alphanumericdict);
print(brute);
</code></pre>

<p>I get this error because the replace() function only takes strings, not lists.</p>

<pre><code>Traceback (most recent call last):
  File "bruteforce.py", line 17, in &lt;module&gt;
    brute = word.replace('-', alphanumericdict);
TypeError: replace() argument 2 must be str, not list
</code></pre>
