title: Python classes from a for loop
body: <p>I've got a piece of code which contains a for loop to draw things from an XML file;</p>
  
  <pre><code>   for evoNode in node.getElementsByTagName('evolution'):
        evoName    = getText(evoNode.getElementsByTagName(        "type")[0].childNodes)
        evoId      = getText(evoNode.getElementsByTagName(      "typeid")[0].childNodes)
        evoLevel   = getText(evoNode.getElementsByTagName(       "level")[0].childNodes)
        evoCost    = getText(evoNode.getElementsByTagName("costperlevel")[0].childNodes)
  
        evolutions.append("%s x %s" % (evoLevel, evoName))
  </code></pre>
  
  <p>Currently it outputs into a list called <code>evolutions</code> as it says in the last line of that code, for this and several other for functions with very similar functionality I need it to output into a class instead.</p>
  
  <pre><code>class evolutions:
      def __init__(self, evoName, evoId, evoLevel, evoCost)
          self.evoName = evoName
          self.evoId = evoId
          self.evoLevel = evoLevel
          self.evoCost = evoCost
  </code></pre>
  
  <p>How to create a series of instances of this class, each of which is a response from that for function? Or what is a core practical solution? This one doesn't really need the class but one of the others really does.</p>