Last active
September 1, 2021 13:24
-
-
Save Vini2/431630f5df4bbe7b9ee386a57360bc80 to your computer and use it in GitHub Desktop.
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 | |
if i == "T": | |
rna += "U" | |
else: | |
rna += i | |
# Print the RNA string | |
print "RNA: ", rna | |
# End of program |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Transcribing DNA into RNA
Solution for problem at ROSALIND.info