I need to read sp_list1 such that three elements from each list from corresponding positions are in a list. The next three (non-overlapping) are put into a separate list such that one makes a list of list.
Input: seq_list1 = ['ATGCTATCATTA','ATGCTATCATTA','ATGCTATCATTT']
Desired Output
seq_list_list1 =[['ATG','ATG','ATG'],['CTA','CTA','CTA'],['TCA','TCA','TCA'],['TTA','TTA','TTT']]
I have a feeling this should be doable using something like list comprehensions, but I can't figure it out (in particular, I can't figure out how to access the index of an item such that one picks three consecutive indices that are non-overlapping when using a list comprehension).