Simplest way to do in Python 2.5 exactly what you ask about:
import itertools as it
... it.izip(it.count(1), xrange(2000, 2005)) ...
If you want a list, as you appear to, use zip
in lieu of it.izip
.
(BTW, as a general rule, the best way to make a list out of a generator or any other iterable X is not [x for x in X]
, but rather list(X)
).