Don't forget to also checkout my second blog containing articles to all other related ICT topics!!

Thursday, May 3, 2012

Itertools count method explained

Itertools count method returns an infinite sequence of numbers starting at count(start,step)
import itertools
for number in itertools.count(0,5):
    if number > 33:
        break
    print number 

0
5
10
15
20
25
30

No comments:

Post a Comment