Creating an naming variables from an array
<p>I have several arrays:</p>

<pre><code>foo_1 = [URL, 2, 30]
foo_2 = [URL, 4, 1230]
foo_3 = [URL, 11, 980]
foo_4 = [URL, 6, 316]
</code></pre>

<p>... I want to create a function that creates variables and renames them like so:</p>

<pre><code>foo_1Count = foo_1[2]
foo_2Count = foo_2[2]
foo_3Count = foo_3[2]
foo_4Count = foo_4[2]
</code></pre>

<p>I am dealing with a very large set of arrays so creating the variables as such one by one isn't easy.  I don't want to use a dictionary if I can help it.  Is there a way to use .format() to create a variable name or something simple that I am missing?  Thanks!</p>

<pre><code>URL = 'www.abc.com'

foo_1 = [URL, 2, 30]
foo_2 = [URL, 4, 1230]
foo_3 = [URL, 11, 980]
foo_4 = [URL, 6, 316]

for i in range(4):
        globals()['foo_{}Count'.format(i+1)] = globals()['foo_{}'.format(i+1)][2]

print foo_4Count    # 316
</code></pre>

python arrays list