title: Dynamically fill a python dictionary
body: <p>How do I dynamically fill a dictionary in Python? For example, suppose I wanted to create a dictionary that held data from a tabulated format text file. Suppose I am creating an APR generator, and I have a list of individual traits with certain data stored as follows (income is rounded to some arbitrary value):</p>
  
  <pre><code>Neighborhood    Income     Risk_Factor    APR
  Brighton        20000      10             .196
  Allston         28500      3              .094
  ...
  </code></pre>
  
  <p>Now later, I want to do a lookup with a dictionary a certain individual:</p>
  
  <pre><code>Herman      Allston     25000    5
  </code></pre>
  
  <p>Now, I want to look up the APR to charge them from the dictionary. It would be checked by:</p>
  
  <pre><code>apr_charge["Allston"][25000][5] = 0.125
  </code></pre>
  
  <p>How would I create this dictionary dynamically? As in, now suppose I have another file for insurance, but now I don't take into account income. So I'd fill out the same type of dictionary with the same code, but now I have one less nested dictionary key. Is this possible? I want to create the nested dictionary without a priori knowledge of how deep the nest goes.</p>
  
  <p>Edit:
  I realize a database could be used to store this information. I wanted to know if it's possible to handle this without use of a database. If it's not possible, I would need a light database that could store into memory. (The fewer dependency headaches, the better. I don't have complete control over the environment that this program would be running on.)</p>