Created
December 19, 2016 03:22
-
-
Save jQwotos/26263d07f93a800d4d03657fb3109627 to your computer and use it in GitHub Desktop.
Takes in a string of codons and converts them into anticodons
This file contains hidden or 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
i = 'AUG|UUU|GUA|CAU|UUG|UGU|GGG|AGU|CAC|CUG|GUU|GAG|GCG|UUG|UAU|UUG|GUU|UGU|GGC|GAG|CCC|GGC|UUU|UAC|CAG|UUA|GAG|AAU|UAC|UGA' | |
x = '' | |
convert = { | |
'A' : 'U', | |
'G' : 'C' | |
} | |
for letter in i: | |
y += i | |
if letter == "|": | |
x += "|" | |
else: | |
for key, value in convert.items(): | |
if letter == key: | |
x += value | |
elif letter == value: | |
x += key | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment