def solve(lis, num):
    for i, (x, y) in enumerate(zip(lis, lis[1:]), 1):
        if y - x >= num:
            yield i
print(list(solve([0, 1, -1, 3, 7, 4, 5, 3, 2, 4, 8], 2)))
How to print out the indexes in a list with repetitive elements