Python - Use a variable as a list name
<p>I have this code in python.</p>

<pre><code>import sys
list1 = ["A", "B", "C"]
list2 = [1, 2, 3]

myarg = sys.argv[1]
print len(myarg)
</code></pre>

<p>I will run this script from command line like this</p>

<pre><code>python script.py list1
</code></pre>

<p>So I need a way to make the len work with the list instead of the variable, I just want to give the name of the list in the var.</p>

<p>I know for this example I can do</p>

<pre><code>if myarg == "list1":
    print len(list1)
else if myarg == "list2"
    print len(list2)
</code></pre>

<p>But I have 13 lists on my script and I need a way to refer to them by the name I give on the command line.</p>
