generate a list of numbers using information from another list
<p>I have a file that looks like this:</p>

<pre><code>100 2
300 3
50 1
500 5
</code></pre>

<p>and I want to generate a pool of numbers where the occurance of the number that is the first number in the list should occur x times (x is the second number in the list).</p>

<p>This is what I want the output to be:</p>

<pre><code>[100, 100, 300, 300, 300, 50, 500, 500, 500, 500, 500]
</code></pre>

<p>I wrote a function like this:</p>

<pre><code>def Pool(pos, count):
    pool = pos*int(count)
    return pool
</code></pre>

<p>and for each line I appended all the numbers to a variable called bigpool</p>

<pre><code>bigpool = []
for line in weightposfile:
    line = line.rstrip()
    f = line.split('\t')
    pos = f[0]
    count = int(f[1])
    pool = Pool(pos, count)
    bigpool.append(pool)
</code></pre>

<p>but this will return a list like this:</p>

<pre><code>[100100, 300300300, 50, 500500500500500]
</code></pre>

<p>How can I seperate the numbers and get the output I want (shown above)?</p>
