Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, but this is:

  from itertools import izip
  izip(xrange(len(seq)), seq)


And in Python 3 it's a generator with

    zip(range(len(seq)), seq)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: