Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created November 6, 2011 17:01
Show Gist options
  • Save marcelcaraciolo/1343177 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/1343177 to your computer and use it in GitHub Desktop.
Search List
list_to_search = [1,4,1,4,6,5,5,5,4,2,3]
elements_to_find = [1,3,5]
search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
search_list(list_to_search, elements_to_find)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment