How to to count Base in DNA

program to count Base in DNA
def count_v2(dna, base):
i = 0
for c in dna:
if c == base:
i += 1
return i

dna = ‘ATGCGGACCTAT’
base = ‘C’
n = count_v2(dna, base)
print(n)

Print sequence in Python
for i in ‘ATGC’:
print i

Leave a Reply

Your email address will not be published. Required fields are marked *