title: Why parameter for lambda function is passed like this?
body: <pre><code>people = ['Dr. Christopher Brooks', 'Dr. Kevyn Collins-Thompson', 'Dr. VG Vinod Vydiswaran', 'Dr. Daniel Romero']
  
  def split_title_and_name(person):
      return person.split()[0] + ' ' + person.split()[-1]
  
  #option 1
  for person in people:
      print(split_title_and_name(person) == (lambda x: x.split()[0] + ' ' + x.split()[-1])(person))
  </code></pre>
  
  <p>When and where to use the above lambda parameter. Since the lambda parameter used above is x but after lambda function, person list is passed inside a parenthesis, which substitutes x.</p>
  
  <p>For the above code, I get 4 True due to 4 items in the list. </p>
  
  <pre><code>#option 1
  for person in people:
      print(split_title_and_name(person) == (lambda person: person.split()[0] + ' ' + person.split()[-1]))
  </code></pre>
  
  <p>But this code doesn't show the same result. It gives 4 False</p>