This file contains 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 the original DNA string | |
print "DNA String: ", dna | |
# Print the count of each letter | |
print "Count of A: ", dna.count("A") | |
print "Count of C: ", dna.count("C") | |
print "Count of G: ", dna.count("G") | |
print "Count of T: ", dna.count("T") | |
# End of program |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Counting DNA Nucleotides
Solution for problem at ROSALIND.info