In [1]:
import itertools
In [2]:
sum_value = 0
for i in itertools.repeat(10):
print(i)
sum_value += i
if sum_value > 40:
break
In [3]:
for i in itertools.repeat(10, 3):
print(i)
In [4]:
for l in itertools.repeat([0, 1, 2], 3):
print(l)
In [5]:
for func in itertools.repeat(len, 3):
print(func('abc'))
In [6]:
l = [0, 1, 2, 3]
In [7]:
print(list(zip(itertools.repeat(10), l)))