test_ok1/py/builtin/enumerate.py

10 lines
195 B
Python

from __future__ import generators
try:
enumerate = enumerate
except NameError:
def enumerate(iterable):
i = 0
for x in iterable:
yield i, x
i += 1