you can track indexes using enumerate as follows:
a = [1, 1, 2, 4, 4, 4, 5, 6, 7, 100]
b = [1, 2, 2, 2, 2, 4, 5, 7, 8, 100]
# 0 1 2 3 4 5 6 7 8 9
print([i for i,x in enumerate(zip(a,b)) if x[0] == x[1]])
[0, 2, 5, 6, 9]
so what's going on here?!
We're taking advantage of the amazing enumerate function! This function generates a tuple for each element in an iterable, with the first element being the enumeration (or the index in this case) and the second being the iterable.
Heres what the enumeration of zip(a,b) looks like
[(0, (1, 1)), (1, (1, 2)), (2, (2, 2)), (3, (4, 2)), (4, (4, 2)), (5, (4, 4)), (6, (5, 5)), (7, (6, 7)), (8, (7, 8)), (9, (100, 100))]
# lets look a little closer at one element
(0, (1, 1))
# ^ ^
# index iterable
From there on it's simple! Unpack the iterable and check if both elements are equal, and if they are then use append the enumeration # to a list!