title: How to access object attribute given string corresponding to name of that attribute
body: <p>How do you set/get the values of attributes of <code>t</code> given by <code>x</code>?</p>
  
  <pre><code>class Test:
     def __init__(self):
         self.attr1 = 1
         self.attr2 = 2
  
  t = Test()
  x = "attr1"
  </code></pre>