from itertools import repeat #repeat a string 10 times r = repeat('Spam', 10) print(r) for i in r: print(i)