pyschools: just what type of formating/output do they want? (Topic 3, Q 11)
<p>Am back again with a pyschools (I don't know why they mark me wrong moment!) See below:</p>

<p><strong>Question:</strong></p>

<p><em>Pairwise comparision of DNA sequences is a popular technique used in Bioinformatics. It usually involves some scoring scheme to express the degree of similarity. Write a function that compares two DNA sequences based on the following scoring scheme: +1 for a match, +3 for each consecutive match and -1 for each mismatch.</em> </p>

<p>I get the exact same answer as they have indicated.</p>

<p><strong>My Code:</strong></p>

<pre><code>def pairwiseScore(seqA, seqB): 
score = 0
seqPos = 0
isConsecutive = False
str1 = ''
for i in seqA:
    if i == seqB[seqPos:seqPos + 1]:
        if isConsecutive == True:
            score += 3
        else:
            score += 1
        isConsecutive = True
        str1 += "|"
    else:
        score -= 1     
        isConsecutive = False
    str1 += " "
    seqPos += 1
score = str(score)
return(seqA + ' ' + str1 + ' ' + seqB + ' Score: ' + score)

pairwiseScore('ATCG', 'ATCG')
pairwiseScore('CATTCATCATGCAA', 'GATAAATCTGGTCT')
</code></pre>

<p><img src="http://i.stack.imgur.com/kWlLL.png" alt="Results from pyschools website">
Where could I be doing wrong? My output string 'looks' exactly as the sites wants. Please assist.</p>

<p>Thanks.</p>
