title: replicating elements in list
body: <p>Say I have this</p>
  
  <pre><code>b = 3
  l = [1, 2]
  </code></pre>
  
  <p>I want to modify l so that each element appears as many times as b. So that:</p>
  
  <pre><code>l = [1, 1, 1, 2, 2, 2]
  </code></pre>
  
  <p>I used this:</p>
  
  <pre><code>for x in l:
    for m in range(b):
      l.append(x)
  </code></pre>
  
  <p>But it resulted in an infinite loop.
  Any help would be appreciated.
  I would prefer you guys to give ideas rather than give me the code.
  Thanks.</p>