I am trying to run a loop within a loop and I am totally confused.
for i, value in enumerate(len(sections):
if i not in [17, 24]:
if (' tax ' in sections[i]
or ' Tax ' in sections[i]):
pat=re.compile("|".join([r"\b{}\b".format(m) for m in months]), re.M)
month = pat.search("\n".join(sections[i].splitlines()[0:6]))
print(month)
The problem is that I want to run the loop for all values in len(sections) except 17 and 24. The idea is the following: for each section (article), if the word tax or tax is in it, print the month. Everything is working but the lines at the beginning, where I am trying to run the loop except the values 17 and 24.
Cheers,
for i, value in enumerate(sections):