title: Lambda filter a list of dictionaries Python
body: <p>I started programming with python a little while ago I have a doubt with dictionary </p>
  
  <p>I have this array and I already have a method that gets an id array, I tried with lambda to create a filtered list,
  My question is if in addition to the filtered list I can leave in the list only the necessary attributes as the example</p>
  
  <p>example:</p>
  
  <pre><code> ages = [{'employedId': 1, 'age': 22},
           {'employedId': 2, 'age': 32},
           {'employedId': 3, 'age': 17},
           {'employedId': 4, 'age': 53},
           {'employedId': 5, 'age': 32},
           {'employedId': 6, 'age': 22}
           ]
  list_filtred = list(filter(lambda tag: tag['age'] == 22, ages))
  </code></pre>
  
  <p><strong>python output</strong></p>
  
  <pre><code>[{'employedId': 1, 'age': 22}, 
   {'employedId': 6, 'age': 22}]
  </code></pre>
  
  <p>Can I create a lambda  filtering method to have such an output or do I have to work on the array to create a new values ​​list?</p>
  
  <p><strong>expected output</strong></p>
  
  <pre><code>[1,6]
  </code></pre>