1
I wonder how I can turn one string on a list where each element of that list is a string with 3 characters from string original. Therefore if the string original was like this "AAGGGTTGG"
I get a list like this ["AAG","GGT","TGG"]
.
I tried the following:
seq = "AAGGGTTGG"
i = 0
codon_lista = []
for i in range(len(seq)):
codon = seq[i:i+3]
codon_lista.append(codon)
i = i + 3
However the result of this is something like:
["AAG", "AGG", "GGG", "GGT", "GTT", "TTG", "TGG", "GG", "G"]