title: DNA longest common subsequence
body: <p>so this is a homework question and it has baffled me a lot. I have attempted numerous times at writing this code and still nothing. The question is finding the longest common subsequence between two DNA strands and printing the sequence. Can anyone here help me and also let me know what to kind of do? I have set the window and used the find function to see where the strings are equal and then set a max function to only display the longest. </p>
  
  <pre><code>def main():
  
  s1 = input("Enter first strand: ")
  s2 = input("Enter second strand: ")
  window = 0
  if len(s1) &lt; len(s2):
      window = len(s1)
  elif len(s1) &gt; len(s2):
      window = len(s2)
  else:
      window = len(s1)
  for i in range(window, 1, -1):
      for j in range(0, i, 1):
       if s1.find(s1[i:i + window]) == s2.find(s2[i:i + window]):
          max = a[0][0]
          for i in range(len(a)):
              for j in range(len(a[i]):
                  if (a[i][j] &gt; max):
                      max = a[i][j]
                      print ("Common Subsequence: ", max)
       else:
          print ("No Common Sequence Found")
  
  main()
  </code></pre>