Python repeat Iterator

Python repeat(i [,n]) repeats i n times, if n is not specified, repeat i for ever.

>>> from itertools import *
>>> x = repeat(1, 5)
>>> for i in x: print(i)
1
1
1
1
1






















endmemo.com © 2024  | Terms of Use | Privacy | Home