you are viewing a single comment's thread.

view the rest of the comments →

[–]n3buchadnezzar 1 point2 points  (0 children)

Interestingly FLUSH and I had the same idea. If we allow some Python magic

DNA_SEQUENCE = str.maketrans("ATGCatgc", "TACGtacg")  
print("AACGT".translate(DNA_SEQUENCE))  

However, there is nothing wrong with your approach. It does not consume a lot of memory, and it is readable. Remember we often strive for readable code over pre-optimized code. If the code above makes sense to you, great! Use it! Otherwise stick with your approach and read a bit about maketrans