title: How can I get all possible "leet" versions of a string (with optional substitutions)?
body: <p>I wrote a straightforward function that converts letters in words to their 'leet' numerical counterparts.</p>
  <pre><code>def Leet(word):
      letters = list(word.lower())
      for n, letter, in enumerate(letters):
          if letter == 'o':
              letters[n]= '0'
          elif letter == 'i':
              letters[n]= '1'
          elif letter == 'z':
              letters[n]= '2'
          elif letter == 'e':
              letters[n]= '3'
          elif letter == 'a':
              letters[n]= '4'
          elif letter == 's':
              letters[n]= '5'
          elif letter == 'g':
              letters[n]= '6'
          elif letter == 't':
              letters[n]= '7'
          elif letter == 'b':
              letters[n]= '8'
      return ''.join(letters)
  </code></pre>
  <p>so when I input <code>'zit'</code>, the program will return <code>'217'</code>.</p>
  <p>My question is, how can I change it to give me every possible result (<code>'217'</code>, <code>'2it'</code>, <code>'z1t'</code>, <code>'zi7'</code>, <code>'21t'</code>, etc.)? I've read about <code>itertools</code> but I am stumped as to how to apply it to my function.</p>