title: How can i pass dictionary keys tree to function as arguments to get a value in the 4-level nested distionary?
body: <p>For example - i have a multylevel nested dictionary</p>
  <pre><code>mydict = {&quot;level00&quot;: {
                        &quot;level01&quot;:[&quot;1&quot;,&quot;2&quot;,&quot;3&quot;],
                        &quot;level02&quot;:{&quot;level10&quot;:&quot;Value1&quot;,&quot;level11&quot;:&quot;Value2&quot;},
                        &quot;level03&quot;:{&quot;level11&quot;:{&quot;level21&quot;:[1,2,3,4],&quot;level22&quot;:&quot;Value3&quot;}
                       }
           }
  </code></pre>
  <p>To get a &quot;Value3&quot; , for example, i should set a tree of indexes like :</p>
  <pre><code>print(mydict[&quot;level00&quot;][&quot;level03&quot;][&quot;level11&quot;][&quot;level22&quot;]) # will get a &quot;Value3&quot;
  </code></pre>
  <p>So my queston is , if i know all dictionary keys, how can i pass this tree as a list to a function, to get any value from the dictionary ?
  Something like :</p>
  <pre><code>keylist = [&quot;level00&quot;,&quot;level03&quot;,&quot;level11&quot;,&quot;level22&quot;]
  neededvalue = getavalue(keylist) #function to return a value from the distionary
  </code></pre>
  <p>keylist can be different</p>
  <p>May be there is a way to transform a list to the indexes tree ??</p>
  <p>Are the any other ways unless an iterations ??</p>