How does this enumerate works? I want a specific starting index but yet the loop goes too far(index out of range)
def endingIndexOfTable(file, index):
r = re.compile('^V.*(.).*(.).*(.).*(-).*(-).*(.).*(.).*(:).*$')
for i, line in enumerate(file, start= index):
if list(filter(r.match, line)) or "Sales Tax" in line:
return i
I want my program to start searching from line index
and to return the line where I find the string I am looking for.