If one had a long list of numbers:
example=['130','90','150','123','133','120','160','45','67','55','34']
and sub lists within the list like
sub_lists=[['130','90','150'],['90','150'],['120','160','45','67']]
how would you generate a function that takes these sublists and gives you the positions that they occurred in the original string? to get the results:
results=[[0-2],[1-2],[5-8]]
I was trying something along the lines of
example=['130','90','150','123','133','120','160','45','67','55','34']
sub_lists=[['130','90','150'],['90','150'],['120','160','45','67']]
for p in range(len(example)):
for lists in sub_lists:
if lists in example:
print p
but that was not working?