Skip to content

Instantly share code, notes, and snippets.

@szeitlin
Created February 12, 2014 02:50
Show Gist options
  • Save szeitlin/8949153 to your computer and use it in GitHub Desktop.
Save szeitlin/8949153 to your computer and use it in GitHub Desktop.
Rosalind problem: convert DNA sequence to RNA.
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