title: Python - neat way of creating multiple objects?
body: <p>I'm fairly new to Python and I have a question about a neat way of creating multiple objects with different properties. At the moment I am having to specifically create each one like this:</p>
  
  <pre><code>object1 = MyClass(property=foo,property2=bar)
  object1.DoStuff(variable = foobar)
  
  object2 = MyClass(property=foo,property2=bar2)
  object2.DoStuff(variable = foobar)
  
  object3 = MyClass(property=foo,property2=bar3)
  object3.DoStuff(variable = foobar)
  </code></pre>
  
  <p>My problem is that I want to create dozens of objects in this way and having to manually create each one like this seems like very bad programming. Is there a better way to create multiple objects with slightly different properties? </p>
  
  <p>I guess what I <em>want</em> to do is something like:</p>
  
  <pre><code>list = [prop1, prop2, prop3, prop4, prop5]
  while i &lt; len(list)
      object_i = MyClass(property=foo,property2=list[i])
      object_i.DoStuff(variable = foobar)
      i+=1
  </code></pre>
  
  <p>And have this create 5 objects named object_1, object_2, etc etc </p>
  
  <p>Is this possible? </p>