title: How can I find this word is Substitutions: or Insertions python
body: <p>For example, my word is "brain", we need to create function that check is it subsitutions and is it insertions.
  For example, Substitutions can be:  train  grain  blain  bryin ... Insertions:  barain  bryain  ...</p>
  
  <pre><code>#I am not sure I did the right way or missing something. And any other way that faster?
  #string0 is pattern
  
  def subsitutions(string0, string1):
       sublist = []
      for i in range(len(string0)):
          sublist.append(string0[:i] + string0[i + 1:])
      for i in range(len(string1)):
          if string1[:i] + string1[i + 1:] in sublist:
              print("This word is subsitutions")
              break
  
  def insertions(string0, string1):
      if len(string0)+1 == len(string1):
          for i in range(len(string1)):
              if string1[:i] + string1[i + 1:] == string0:
                  print("This word is insertions")
                  break
  </code></pre>