L=[0,8,5,6,4,5,6,14,8]
I want to be able to return the index of [4,5,6] (returning 4 in this example).
Here's one way to implement it:
def find_in_list(l, x):
for i in range(len(l) - len(x) + 1):
if l[i:i+len(x)] == x:
return i
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With