News for hackers. Stuff that matters.
Re:Hidden features of Python by eru on Wednesday July 14, 2010 @03:10PM (#1515612)
Yes, enumerate is useful for that. But even if you did not now about it you could have used count from itertools to get the same effect:

  import itertools
  for (index, item) in zip(itertools.count(0), "hallo"):
      print index, item
Itertools is worth checking out for other goodies, too.

There are no comments on this comment yet.