Bjoern Schliessmann wrote: >> define "it". > > Sorry! I mean iterating over a list and having the list index > available in the loop. Like: > > for i, thing in enumerate(things): > pass
"enumerate" is the obviously right thing for this, sure. but it's not necessarily the right thing for the OP's "I want to create a new list based on an existing list". modifying the existing list is usually not the most efficient way to do that. </F> -- http://mail.python.org/mailman/listinfo/python-list