title: Python - create dynamic nested dictionary from list of dictionary
body: <p>Below is sample list data, I want to convert it into a dynamic dictionary.</p>
  
  <pre><code>result = [
      {
          "standard": "119",
          "score": "0",
          "type": "assignment",
          "student": "4"
      },
      {
          "standard": "119",
          "score": "0",
          "type": "assignment",
          "student": "5"
      },
      {
          "standard": "118",
          "score": "0",
          "type": "assessment",
          "student": "4"
      }
  ]
  </code></pre>
  
  <p>I want to create one function conv_to_nested_dict(*args,data), which convertes all list of key to dictonary dynamically. </p>
  
  <p>For example : conv_to_nested_dict(['standard','student'],result) should give op :</p>
  
  <pre><code>{
      "118": {
          "4": [{
              "score": "0",
              "type": "assessment"
          }]
      },
      "119": {
          "4": [{
              "score": "0",
              "type": "assignment"
          }],
          "5": [{
              "score": "0",
              "type": "assignment"
          }]
      }
  
  }
  </code></pre>
  
  <p>conv_to_nested_dict(['standard','type'],result)</p>
  
  <pre><code>{
      "118": {
          "assessment": [{
              "score": 0,
              "student": "4"
          }]
      },
      "119": {
          "assignment": [{
              "score": 0,
              "student": "4"
          },{
              "score": 0,
              "student": "5"
          }]
      }
  
  }
  </code></pre>