title: Find Maximum Value in Nested Dictionary and return Key
body: <p>So I have this block of code</p>
  
  <pre><code>dictionary = {
    'key1': {'a': 1, 'b': 2, 'c': 10}, 
    'key2': {'d': 1, 'e': 1, 'c': 11}, 
    'key3': {'d': 2, 'b': 1, 'g': 12}}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>list1 = (a,b,c)
  </code></pre>
  
  <p>What I want to do is run a loop that finds the maximums of all the items in the list and returns the key. So for example, the maximum of 'c' would return 'key2', the maximum of 'b' would return 'key1', etc.</p>
  
  <p>So far I have</p>
  
  <pre><code>for value in list1:
       m = max(dictionary, key=lambda v: dictionary[v][value])
       print(m + "\n")
  </code></pre>
  
  <p>But this only works if the same subkey exists in all keys in the dictionary. Any ideas on what to do?</p>