Most viewed recipes tagged "enumerate"http://code.activestate.com/recipes/tags/enumerate/views/2012-12-11T16:59:14-08:00ActiveState Code RecipesFind Multiple Elements In a List (Python)
2011-11-05T23:40:41-07:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/577943-find-multiple-elements-in-a-list/
<p style="color: grey">
Python
recipe 577943
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/enumerate/">enumerate</a>, <a href="/recipes/tags/find/">find</a>, <a href="/recipes/tags/list/">list</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/search_list/">search_list</a>).
</p>
<p>This algorithm searches for more than one element in a list. The input is a list that you want to search through and a list of elements that you want to search for. The output is a multidimensional list with the positions of the elements you are searching for in the search list in the order that you listed them. </p>
An analogue of enumerate for nested lists. (Python)
2012-12-11T16:59:14-08:00John Crichtonhttp://code.activestate.com/recipes/users/4181975/http://code.activestate.com/recipes/578376-an-analogue-of-enumerate-for-nested-lists/
<p style="color: grey">
Python
recipe 578376
by <a href="/recipes/users/4181975/">John Crichton</a>
(<a href="/recipes/tags/enumerate/">enumerate</a>, <a href="/recipes/tags/index/">index</a>, <a href="/recipes/tags/iterator/">iterator</a>, <a href="/recipes/tags/list/">list</a>).
Revision 6.
</p>
<p>A generator function which enables traversal and modification of deeply nested lists. Together with the supplied helper functions it could be useful when working with data stored in deeply
nested lists, particularly when the level of nesting precludes a recursive approach.</p>