title: Python: Append item to list N times
body: <p>This seems like something Python would have a shortcut for. I want to append an item to a list N times, effectively doing this:</p>
  <pre><code>l = []
  x = 0
  for i in range(100):
      l.append(x)
  </code></pre>
  <p>It would seem to me that there should be an &quot;optimized&quot; method for that, something like:</p>
  <pre><code>l.append_multiple(x, 100)
  </code></pre>
  <p>Is there?</p>
  <hr />
  <p><sub>If you want to append elements <em>from another sequence</em> (instead of the same value repeatedly, you can just <code>.extend</code> with that sequence directly. See <a href="https://stackoverflow.com/questions/6339235">How to append to the end of an empty list?</a>.</sub></p>