Skip to content

Instantly share code, notes, and snippets.

@Vini2
Last active September 1, 2021 13:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vini2/431630f5df4bbe7b9ee386a57360bc80 to your computer and use it in GitHub Desktop.
Save Vini2/431630f5df4bbe7b9ee386a57360bc80 to your computer and use it in GitHub Desktop.
# 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
@Vini2
Copy link
Author

Vini2 commented Aug 12, 2017

Transcribing DNA into RNA
Solution for problem at ROSALIND.info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment