Created
September 18, 2016 15:36
-
-
Save xavicolomer/d105034ab2b3ac18eba6c7a1999654ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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