Comparing two lists and "looking back"
<p>How would you approach comparing two lists and "looking back"?</p>

<p>I'm comparing the elements of two lists like this:</p>

<pre><code>score = 0
for (x,y) in zip(seqA,seqB):

    if x == y:
        score = score +1

    if x !=y :
        score = score - 1
</code></pre>

<p>Now I would like <code>score + 3</code> if the <strong>previous</strong> pair was a match, so basically I would have to "look back" one iteration.</p>
