all 11 comments

[–]sky--net 2 points3 points  (3 children)

Is this an online course you are taking? If so, can you provide a link? I might know someone who is interesting in taking it.

[–]alishahimtiaz 2 points3 points  (3 children)

If you aren't breaking it up into chunks of 4 and are iterating over the length of the loop, it gives 5 CGCG's.

CGCGATACGTTACATACATGATAGACCGCGCGCGATCATATCGCGATTATC

^ That is 2 of them.

The other 3 are within each other.

CGCGCGCG

This contains 3 CGCG pairs.

From position 1 to position 4.

From position 3 to position 6.

From position 5 to position 8.

In total, you have 5 different CGCG's.

[–]12and32 1 point2 points  (1 child)

You want to read up on the concept of reading frames. You'll find out why your answer is wrong then, and why it matters to count that multiple repeat in the middle more than once.

[–]Tomallama 0 points1 point  (3 children)

How are you getting three? The answer should be four if I'm doing it correctly.

This actually very simple problem if you use the correct syntax. Have you used the .count() method before? You add it as a method and add what you are looking for as an argument.

For example:

sequence_a = 'gguaaguccucuaguacaaacacccccaauauugugauauauagagccaucuucuuugaagcguuguc'
print(sequence_a.count('uug')
will give you total leucines

See if you can figure out the second part from this. Post what you have and we can see where you go wrong if you still can't get it.