You can use a simple loop with a flag that alternates every time a """ is found:
data = ['value', '"""', 'Comment 1st row', 'Comment 2nd row',
'Comment 3rd row', '"""', 'another value']
flag = True
out = []
for v in data:
if v == '"""':
flag = not flag # invert the flag's boolean value
continue # we have a comment, skip to the next step
if flag: # if flag is True, add the item
out.append(v)
print(out)
output:
['value', 'another value']
Example run on data = data * 5 to mimic multiple comments:
['value', 'another value', 'value', 'another value',
'value', 'another value', 'value', 'another value',
'value', 'another value']
'"""? '"""', 'Comment 1st row', 'Comment 2nd row', 'Comment 3rd row', '"""'