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
# Read the file and get the RNA string | |
file = open('sample_rna.txt', 'r') | |
rna = file.read() | |
print "RNA String: ", rna | |
# RNA codon table | |
rna_codon = {"UUU" : "F", "CUU" : "L", "AUU" : "I", "GUU" : "V", | |
"UUC" : "F", "CUC" : "L", "AUC" : "I", "GUC" : "V", | |
"UUA" : "L", "CUA" : "L", "AUA" : "I", "GUA" : "V", |
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
# Read the file and get the DNA string | |
file = open('sample_dna.txt', 'r') | |
dna = file.read() | |
print "DNA: ", dna | |
rna = "" | |
# Generate the RNA string | |
for i in dna: | |
# Replace all occurrences of T with U |