I'm trying to make a program to do RNA Synthesis for me in biology because it's extremely tedious. I have gotten to the step in the program where I take the string and split it into a list in groups of 3:
sssdddfff --> ['sss', 'ddd', 'fff']
This the method that I'm trying works in my head, but it doesn't seem to work if I actually run it. Here's the code:
list = []
i = 1
num = 1
digit = 0
while num * 3 < len(dna):
while i < 3:
i = i + 1
list.insert(num, dna[digit])
digit = digit + 1
num = num + 1
print (list)
I've shown you what I expect, but whenever I put this string in sssdddfff
as a test, I get this instead of what I needed to happen: ['s', 's']
I'm not sure if I just made a dumb mistake or if there's an easier way to do this, but I can't find anything.