title: Why lambda function is not applicable in case of list comprehension, whereas some other user defined function works in the list comprehension?
body: <p>I have changed my question a bit, I think my question was not clear before. Apologies!!!</p>
  
  <p>I have mentioned two cases below: one with lambda function and the other with a user defined function.</p>
  
  <p>Case 1: Using a lambda function.</p>
  
  <pre><code>[lambda i: i*2  for i in range(4) ]
  </code></pre>
  
  <p>The output is the list of 4 same functions as given below:</p>
  
  <pre><code>[&lt;function __main__.&lt;listcomp&gt;.&lt;lambda&gt;(i)&gt;,
   &lt;function __main__.&lt;listcomp&gt;.&lt;lambda&gt;(i)&gt;,
   &lt;function __main__.&lt;listcomp&gt;.&lt;lambda&gt;(i)&gt;,
   &lt;function __main__.&lt;listcomp&gt;.&lt;lambda&gt;(i)&gt;]
  </code></pre>
  
  <p>Case 2: Using a user defined function</p>
  
  <pre><code>def func(x):
     return(x*2)
  
  [func(i)  for i in range(4) ]
  </code></pre>
  
  <p>The output here is as intended. </p>
  
  <pre><code>[0, 2, 4, 6]
  </code></pre>