This seems like something Python would have a shortcut for. I want to append an item to a list N times, effectively doing this:
l = [] x = 0 for i in range(1
Itertools repeat combined with list extend.
from itertools import repeat l = [] l.extend(repeat(x, 100))