title: Calling attribute of class via for loop causes an error
body: <p>The code below</p>
  
  <pre><code>class attsClass():
      def __init__(self,aw,ax,ay,az):
          self.aw = aw
          self.ax = ax
          self.ay = ay
          self.az = az
  ac = attsClass('W','X','Y','Z')
  ac.ax
  </code></pre>
  
  <p>here I will get the result which is 'X',but if i call like how i did below we get an error</p>
  
  <pre><code>att_names = ['aw','ax','ay','az']
  for att in att_names:
      print(ac.att)
  </code></pre>
  
  <p>here I can't access the attribute </p>
  
  <p>only with this can I access it</p>
  
  <pre><code>att_names = ['ax','ay','az']
  for att in att_names:
      print(att, getattr(ac, att))
  </code></pre>
  
  <p>can someone explain why?</p>