title: more efficient way to create instance attributes in classes in python3
body: <p>I'm a newby and just learned about classes in python3. Now i wrote an exchanchable code to practice a little bit, and wonder, if there's a way to make this code &quot;smarter&quot;.</p>
  <pre><code>dic = {
      &quot;1&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;1.&quot;, &quot;entry&quot;],
      &quot;2&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;2.&quot;, &quot;entry&quot;],
      &quot;3&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;3.&quot;, &quot;entry&quot;],
      &quot;4&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;4.&quot;, &quot;entry&quot;],
      &quot;5&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;5.&quot;, &quot;entry&quot;],
  }
  
  class words:
      def __init__(self, word1, word2, word3, word4, word5):
          self.word1 = word1
          self.word2 = word2
          self.word3 = word3
          self.word4 = word4
          self.word5 = word5
  
  for i in dic:
      globals()[f&quot;entry{i}&quot;] = words(dic[i][0],dic[i][1],dic[i][2],dic[i][3],dic[i][4])
  
  print(entry3.__dict__)
  </code></pre>
  <p>The dic above is meant to define the start-values for each instance of the class. Later on there can be ways to modify the attributes for these instances, but that's not important right now.</p>
  <p>Like this is written, it's pretty unflexible. If I wanna add another element into an dic-element like this</p>
  <pre><code>&quot;1&quot;: [&quot;I&quot;, &quot;am&quot;, &quot;the&quot;, &quot;1.&quot;, &quot;entry&quot;, &quot;!&quot;],
  </code></pre>
  <p>I would have to add a parameter in <strong>init</strong> like</p>
  <pre><code>__init__(self,word1,...,word5,word6)
  </code></pre>
  <p>and also add into <strong>init</strong>-function</p>
  <pre><code>self.word6 = word6
  </code></pre>
  <p>and also add parameter-entry in the definition of the instances like</p>
  <pre><code>globals()[f&quot;entry{i}&quot;] = words(Vz[i][0],...,Vz[i][4],Vz[i][5])
  </code></pre>
  <p>Is there any way to automate this process (like looping through them), so if I wanna add another start value for the instances of the class, I don't have to add all these things too?</p>