title: Duplicating a list N number of times
body: <p>I want to duplicate a list n number of times while preserving the order of the list itself. For example all I have right now and it doesn't work nor does it give me an error.</p>
  
  <pre><code>def duplicate(testList, n):
      y = 0
      x = len(testList)
      newList=[]
      while y &lt; x:
          for z in range (0, n):
              newList.append(testList[y])
          y = y + 1
      return newList
  
  duplicate([1,2,3], 3)
  </code></pre>
  
  <p>After this im not sure where to fix it.</p>
  
  <p>The desired output is:</p>
  
  <pre><code>[1,1,1,2,2,2,3,3,3]
  </code></pre>