title: Python 3.6 iterating through list of dictionaries using filter() with lambda doesn't return dictionary's value
body: <p>There is a list of dictionaries I need to iterate through and filter in dictionaries which meet criterion and then return only values under key1. I'm using filter, as follows:</p>
  
  <pre><code>res = list(filter(lambda x: x["key1"] if ["key2"] == criterion else False, list_of_dicts))
  </code></pre>
  
  <p>the iterator works alright returning only those results which meet criterion. But it returns the whole dictionary rather than only <code>x["key1"]</code>.
  I'm thinking it's something to do with filter but have no clue. </p>
  
  <p>Q1: Can someone explain why it returns whole dict rather then only value under key1?</p>
  
  <p>Q2: is there a workaround to make filter to return only value under key1?</p>
  
  <p>P.S. there is no problem to do it through list comprehension like that:</p>
  
  <pre><code>res = [i["key1"] for i in list_of_dicts if i["key2"] == criterion]
  </code></pre>
  
  <p>But I was just curious why filter doesn't return <code>i["key1"]</code>.</p>