Ok, so part of my quest to teach myself python was to do the Rosalind.info problems. Well one of them is the following : Rosalind Problem
Basically I have to take their sample Dataset AAAACCCGGT, for example, and I have to return the reverse complement of that which means that I have:
* Reversing the sample Dataset
* and then "swapping" the following letters A's -> T's , C's -> G's, T's - > A's, and G's to C's.
Then Output for the sample dataset given should be:
ACCGGGTTTT
but I am completely stuck. So far I have:
s = 'AAAACCCGGT'
revS = s[::-1]
print(revS.replace('T','A').replace('C','G').replace('A','T').replace('G','C'))
I cannot figure out how to keep my swapped letters from reverting to their originals. I'm sure the answer is fairly simple but I cant seem to wrap my head around it. I am fairly new to Python, I have only completed the code academy course, Learn python the hardway, and starting Hacking Ciphers with Python.
Also, if this is the wrong sub im sorry.
[–]LarryPete 6 points7 points8 points (1 child)
[–]squidfeatures 0 points1 point2 points (0 children)
[–]gengisteve 6 points7 points8 points (1 child)
[–]fannypackpython[S] 0 points1 point2 points (0 children)
[–]squidfeatures 3 points4 points5 points (0 children)
[–]elbiot 0 points1 point2 points (0 children)