title: Using recursive function instead of loops
body: <p>I’m trying to build a scoring matrix using recursive,</p>
  
  <pre><code>    for i in range(1, len(str1))
          for j in range(1, len(str))
          #do something
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>def matrix_bulid(index_1, index_2):
      print(index_1, index_2)
      if index_1 == len(first_dna) and index_2 == len(second_dna):
          return
      elif index_2 == len(second_dna):
          return matrix_bulid(index_1 + 1, 1)
      else:
      #do something
              matrix_bulid(index_1, index_2 + 1)
  </code></pre>
  
  <p>but in really long strings , i get max depth error thing.
  does anyone has any idea how to do it?</p>