title: Repeating elements of a list n times
body: <p>How do I repeat each element of a list <code>n</code> times and form a new list? For example:</p>
  <pre><code>x = [1,2,3,4]
  n = 3
  
  x1 = [1,1,1,2,2,2,3,3,3,4,4,4]
  </code></pre>
  <p><code>x * n</code> doesn't work</p>
  <pre><code>for i in x[i]:
      x1 = n * x[i]
  </code></pre>
  <p>There must be a simple and smart way.</p>