title: Python call class method from iterable value in for loop
body: <p>Say have a simple class as follows:</p>
  
  <pre><code>class Test:
      some_attributes
  
      def first_method():
          pass
  
      def second_method():
          pass
  </code></pre>
  
  <p>Now lets say I have put the list of methods in a list like so: <code>methods=['first_method', 'second_method']</code></p>
  
  <p>The question that has perplexed me is:‌ How can I‌ call the methods using the list above in a for loop. The scheme I want is like this:</p>
  
  <pre><code>for method in methods:
      Test.method
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>for method in methods:
      'Test.{}'.formats(method)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for method in methods:
      vars()['Test.{}'.formats(method)]
  </code></pre>
  
  <p>How can I achieve this concept?</p>