title: Lambda with if condition in map()
body: <p>I have this bit of a practice code:</p>
  
  <pre><code>even = []
  odd = []
  
  for x in range(1000):
      if x % 2 != 0:
          odd.append(x)
      else:
          even.append(x)
  
  print map(lambda x: x if str(x)[-1] == '2' else pass, even)
  
  print even
  print odd
  </code></pre>
  
  <p>In my mind, I should get in the end full list of odd numbers in 0 - 999 range and a list of even numbers from the same range which do not end with "2". In practice however, I keep on getting syntax error pointing to the "pass" in lambda expression.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>Cheers,
  Greem</p>