roy spewed: > The real question is *why* do you want the index? > > If you're trying to iterate through list indicies, you're probably trying > to write C, C++, Fortran, Java, etc in Python.
Could we stop the stupid continual beratement of people validly asking about enumerate()? Yes, we want to discourage: for i in xrange(len(seq)): seq[i] but in this case, and many other cases, that is clearly not the question being posed. enumerate is one of the most useful built-ins and a love the way it reads in code. Stop the index-hate. -Mike -- http://mail.python.org/mailman/listinfo/python-list