li = [-1, -1, 2, 2, -1, 1, 1, 1, 1, 1, -1, -1]
results = []
i = 0
while i < len(li):
    j = i + 1
while j < len(li) and li[i] == li[j]:
    j += 1
results.append((i, li[i], j - i))
i = j
print(results)
Sequence of elements in a list satisfying a condition