title: How to get the value of a variable given its name in a string?
body: <p>For simplicity this is a stripped down version of what I want to do:</p>
  
  <pre><code>def foo(a):
      # I want to print the value of the variable
      # the name of which is contained in a
  </code></pre>
  
  <p>I know how to do this in PHP:</p>
  
  <pre><code>function foo($a) {
      echo $$a;
  }
  
  global $string = "blah"; // might not need to be global but that's irrelevant
  foo("string"); // prints "blah"
  </code></pre>
  
  <p>Any way to do this?</p>