title: Print Number N times from array with Python
body: <p>I've seen several examples of printing a string multiple times and can't find the solution to print out an int multiple times. </p>
  
  <p>I have two arrays.</p>
  
  <p>I want to print out 1, 1 time 3,2 times and 4, 2 times.
  I know I can't use the * operator as I would to print a string n times</p>
  
  <p>How can I get to </p>
  
  <pre><code>[1,3,3,4,4]
  </code></pre>
  
  <p>The code I wrote is as follows:</p>
  
  <pre><code>A = [1, 3, 4]
  B = [1, 2, 2]
  i = 0
  j = 0
  for i in range(0, len(A), 1):
      for j in range(0, len(B), 1):
          if i==j:
              print A[i] * B[j]
  </code></pre>
  
  <p>UPDATE: I edited the code to reflect actual numbers since I tested one code and posted another. Sorry about that.</p>