Created
February 12, 2014 02:50
-
-
Save szeitlin/8949153 to your computer and use it in GitHub Desktop.
Rosalind problem: convert DNA sequence to RNA.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transcribe(s): | |
'''given a DNA string, replace each T with a U and write it back out as RNA | |
(str) -> (str) | |
>>>transcribe('ATGCCCGGGTTTAAA') | |
AUGCCCGGGUUUAAA | |
''' | |
RNA = s.replace('T','U') | |
print(RNA) | |
#s. replace doesn't actually overwrite the original string s, so have to save it to a new one, RNA. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment