title: Python Generate a dynamic dictionary from the list of keys
body: <p>I do have a list as given below -</p>
  
  <pre><code>keyList1 = ["Person", "Male", "Boy", "Student", "id_123", "Name"]
  value1 = "Roger"
  </code></pre>
  
  <p>How can I generate dynamic dictionary which can be retrieved as below -</p>
  
  <pre><code>mydict["Person"]["Male"]["Boy"]["Student"]["id_123"]["Name"] = value
  </code></pre>
  
  <p>The list could be anything; Variable Length or consisting of "N" number of elements unknown to me...</p>
  
  <p>Now  I do have another list, so that My dictionary should be updated accordingly </p>
  
  <pre><code>keyList2 = ["Person", "Male", "Boy", "Student", "id_123", "Age"]
  value2 = 25
  </code></pre>
  
  <p>i.e. If Keys "Person", "Male", "Boy", "Student", "id_123" already exists, the new key "age" should be appended ...</p>