I have this code to split a DNA strand into groups of 3. Everything in the result is intended except for that last "None"
def codons(x):
for i in range(0, len(x), 3):
result = print(x[i:i + 3])
return result
When using with
print(codons('ATGCTCAAGTAGR'))
Returns:
ATG
CTC
AAG
TAG
R
None