title: Approximate pattern matching?
body: <p>I am trying to write code for Approximate Pattern Matching which is as below:</p>
  
  <pre><code>def HammingDistance(p, q):
      d = 0
      for p, q in zip(p, q): # your code here
          if p!= q:
              d += 1
      return d
  Pattern = "ATTCTGGA"
  Text = "CGCCCGAATCCAGAACGCATTCCCATATTTCGGGACCACTGGCCTCCACGGTACGGACGTCAATCAAAT"
  d = 3
  def ApproximatePatternMatching(Pattern, Text, d):
      positions = [] # initializing list of positions
      for i in range(len(Text) - len(Pattern)+1):
          if Pattern == Text[i:i+len(Pattern)]:
              positions.append(i)# your code here
      return positions
  print (ApproximatePatternMatching(Pattern, Text, d))
  </code></pre>
  
  <p>I keep getting the following error:
  Failed test #3. You may be failing to account for patterns starting at the first index of text.</p>
  
  <p>Test Dataset:</p>
  
  <pre><code>GAGCGCTGG
  GAGCGCTGGGTTAACTCGCTACTTCCCGACGAGCGCTGTGGCGCAAATTGGCGATGAAACTGCAGAGAGAACTGGTCATCCAACTGAATTCTCCCCGCTATCGCATTTTGATGCGCGCCGCGTCGATT
  2
  </code></pre>
  
  <p>Your output:</p>
  
  <pre><code>['[]', '0']
  </code></pre>
  
  <p>Correct output:</p>
  
  <pre><code>['0', '30', '66']
  </code></pre>
  
  <p>Can not figure out what I am doing wrong as I am trying to learn python so don't have any idea about programming. Need help?</p>