Hello to Masters of Python!
As the title says, I have to concatenate substrings with the information provided in two lists of start and end position, respectively.
For example,
string = 'AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJKKKK'
start_list = [0,8,16,24]
end_list = [4,12,20,28]
The end result should be like
print (string[0:4]+string[8:12]+string[16:20]+string[24:28])
AAAACCCCEEEEGGGG
if the start and end positions increase, I have to do it with for loop iterating start and end positions of each elements in the two lists.
Could you please help me go through this?
Thank you in advance.