I can't understand the function.. Perhaps I may show you the problem of my assignment:
"Write a function ReverseComplement to solve the Reverse Complement Problem"
Find the reverse complement of a DNA string.
Input: A DNA string Pattern.
Output: The reverse complement of Pattern.
My code was:
Input: A DNA string Pattern
Pattern = "AAAACCCGGT"
Output: The reverse complement of Pattern
def ReverseComplement(Pattern): revComp = '' index = len(Pattern) - 1 for i in range(0,len(Pattern)): revComp = revComp + Pattern[index] index = index - 1 return revComp print (ReverseComplement(Pattern))
Can Anyone explaining me why my output is "T"? What I can't see?
Thank you in advance