title: How to do mutation with word in python?
body: <p>I'm tryin to play with words. For example, I read word "script" from a txt file. Then would like to do all mutations of letters and write each of them.
  So here are changes</p>
  
  <pre><code> s=$
   s=5
   s=S
   s=s
   c=(
   c=[
   c={
   c=&lt;
   c=c
   c=C
   r=r
   r=R
   i=i
   i=I
   i=|
   i=1
   i=!
   .
   .
   .
  </code></pre>
  
  <p>What i was thinking to get is</p>
  
  <pre><code> scrypt
   $crypt
   5cript
   Scrypt
   s(ript
   $(cript
   .
   .
   .
  </code></pre>
  
  <p>So all possible combinations. Similar to itertool.product
  I'm little confused how to do that. I started like this</p>
  
  <pre><code> def main():
  
      with open('file1.txt', 'r') as f1, open('file2.txt', 'w') as f2:
         for word in f1:
             l=len(word)
             for i in range(l):
                 if word[i] = s:
                     word1=word[i].raplace("$") #don't know if sintacs is ok
                     f2.write(word1)
                 else: 
                     if word[i] = c:
                  .
                  .
  </code></pre>
  
  <p>Now I'm confused here. I would have to ask for every letter in alphabet and I'm complicating this. </p>
  
  <p>I would probably need to have lots of loops inside loop. I think how many characters in word thats how manu for loops.</p>
  
  <p><br></p>
  
  <p>ITs to complicated and probably to slow. Is there some easy way? Some function (tool) to import?</p>
  
  <p>Question is how to deal with to same letter in one word and how t</p>
  
  <p>P.S I'm using python 3.4.2</p>