title: Is there a better way to create a list of values of a nested dictionary?
body: <p>I made a nested dictionary </p>
  
  <pre><code>d = {
      'first':{
          'key': 'A',
          'val': 1
      },
      'second':{
          'key': 'A',
          'val': 2
      },
      'third':{
          'key': 'B',
          'val': 5
      },
      'fourth':{
          'key': 'B',
          'val': 7
      }
  }
  </code></pre>
  
  <p>Now suppose I wanted to create a list of values of the nested dictionaries with key being 'key'.
  What I mean by that is, I want a list of such manner:</p>
  
  <pre><code>L = ['A', 'A', 'B', 'B']
  </code></pre>
  
  <p>I managed to do it with the help of for loops and value() in this manner:</p>
  
  <pre><code>List = d.values()
  L = []
  for K in List:
      L.append(K['key'])
  print(L)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>['A', 'A', 'B', 'B']
  </code></pre>
  
  <p>but is there something cleaner out there?</p>