What do you want to save?
Add Code snippet
New code examples
-
Python 2021-08-29 13:02:02
find index of sublist in list python
greeting = ['hello','my','name','is','bob','how','are','you','my','name','is'] def find_sub_list(sl,l): results=[] sll=len(sl) for ind in (i for i,e in enumerate(l) if e==sl[0]): if l[ind:ind+sll]==sl: results.append((ind,... Add solution