how to get list iteration number in python code example
Example 1: list iteration
def count_v1(dna, base):
dna = list(dna) # convert string to list of letters
i = 0 # counter
for c in dna:
if c == base:
i += 1
return i
Example 2: list iteration
>>> list('ATGC')
['A', 'T', 'G', 'C']