title: How do you convert a string into the name of an already created variable/list in python?
body: <p>So basically here's a simplified version of my problem:</p>
  <pre><code>list1 = [&quot;hi&quot;, &quot;hello&quot;, &quot;bye&quot;]
  list2 = [&quot;x&quot;, &quot;y&quot;, &quot;z&quot;]
  variable = either &quot;list1&quot; or &quot;list2&quot;
  </code></pre>
  <p>And so I want to print the list that the value of the variable currently is but since it's a string, if you print it, it'll just print <code>&quot;list1&quot;</code> or <code>&quot;list2&quot;</code>. How could you print the correct list? Is there some function (I tried looking up one but I'm completely confused) that could convert it to a list name? Or some other way?</p>