title: Creating Objects in Python using a Dictionary
body: <p>I was working on a python code that allowed a user to create categories, then fill in these with as many objects they wanted. Last, I printed everything and created a text document with the info using File I/O.</p>
  
  <p>Because the user can enter as many categories and airplanes, I couldn't control the number of parameters in the <strong>init</strong> for the class. I wanted to create a dictionary that created properties for the Airplane object that were the keys of the dictionary, and values for these properties that were the values. How would I do this?</p>
  
  <p>Thanks.</p>
  
  <pre><code>    class Airplane:
          def __init__(self, dictionaryPerhaps):
              #How could I make properties that were the keys and had properties that were the values?
              pass
  
      def objectCreation(valuesOC, catagoriesOC):
          thePlanes = { }
          for each in catagoriesOC:
               thePlanes [each] = valuesOC[each]
  
          theAirplaneObject = Airplane(thePlanes)
  </code></pre>