title: Is there a way to pass a composed key for a dictionary as argument of a function?
body: <p>I have a function that should use the value of the key that we pass as argument. The key would lookup the value in a nested dictionary. Ex:</p>
  <p>nested_dict = ... # dump from json a very nested dictionary</p>
  <pre><code>def get_value(nested_dict, composed_key):
      # ? nested_dict[composed_key]
  </code></pre>
  <p>Is there a way to do this :</p>
  <pre><code>get_value(nested_dict, [&quot;level1&quot;][&quot;level2&quot;]...[&quot;leveln&quot;])
  </code></pre>
  <p>Or :</p>
  <pre><code>get_value(nested_dict, &quot;level1.level2...leveln&quot;)
  </code></pre>
  <p>?</p>
  <p>How can I do?</p>
  <p>Thanks</p>