Python itertools repeat()

PHOTO EMBED

Tue Jun 18 2024 02:07:54 GMT+0000 (Coordinated Universal Time)

Saved by @pynerds #python

from itertools import repeat

#repeat a string 10 times
r = repeat('Spam', 10)
print(r)

for i in r:
    print(i)
content_copyCOPY

https://www.pynerds.com/python-itertools-repeat/