Moving the Counter Into the Foreach Loop

Recently I did a little code review for a friend of mine.
He needed a counter while iterating items of a list.
He solved it the same way I did - many times befor, always a little bit annoyed by the fact that I needed to declare and incredent the counter myself.

zip takes n lists and combines thouse elements into tubles, drawing from all lists, stoping if one of the lists is exeeded. This makes it very usefull in combination with infinit lists.

Ok now this takes care of incrementing i for us, nice :) .
However it’s still cumbersome to have to specify the range.
What we really want is a lazy sequenze of integers that just counts up starting at a value of our choosing.
Python itertools to the rescure.
The iter tools provide a count() function that returns this generator: