title: Repeat a sequence of a list
body: <p><strong>Problem</strong></p>
  <p>Given the following list:</p>
  <pre><code>l=[1,2,3,4,5,6]
  </code></pre>
  <p>I want to repeat the <code>n</code> first elements of the list <code>r</code> times, and after that, do the same for the next <code>n</code> elements of the list, and so on...</p>
  <p>For example, for <code>n=2</code> and <code>r=2</code>:</p>
  <pre><code>result=[1,2,1,2,3,4,3,4,5,6,5,6]
  </code></pre>
  <p>And for  <code>n=3</code> and <code>r=2</code>:</p>
  <pre><code>result=[1,2,3,1,2,3,4,5,6,4,5,6]
  </code></pre>
  <p><strong>My clumsy attempt</strong></p>
  <pre><code>l=[1,2,3,4,5,6]
  n=3
  r=2
  l_new=[]
  result=[]
  for i in range(0,len(l),n):
      reduced=l[i:(n+i)]
      l_new.append(reduced)
  
  for elem in l_new:
      elem_new=elem*r
      result+=(elem_new)
  </code></pre>
  <p>How can I improve this code? What is a more clean/efficient/good practice way of doing this?</p>