Skip to content

Instantly share code, notes, and snippets.

@xavicolomer
Created September 18, 2016 15:36
Show Gist options
  • Save xavicolomer/d105034ab2b3ac18eba6c7a1999654ea to your computer and use it in GitHub Desktop.
Save xavicolomer/d105034ab2b3ac18eba6c7a1999654ea to your computer and use it in GitHub Desktop.
a = [1,3,5,2,1,3,5,2,2,5,6,5,25,7,2,1,3,5,2,2,2,5,7,2,1,3,5,2,5]
b = [2,2,5]
indexes = []
for i in range(len(a)):
if a[i:i+len(b)] == b:
indexes.append((i, i+len(b)))
print(indexes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment