0
Why is the comma making difference in the output?
print((lambda x: x**2 + 5*x + 4) (-4)) output:0 print((lambda x: x**2 + 5*x + 4), (-4)) output:<function <lambda> at 0Ă7ff8766b51f0> -4
2 Answers
+ 4
In first , case you are calling lambda function with parameter -4 so returns -4**2 +5*-4 + 4 => 20-20 => 0
In second case, two arguments are different, no relation. First print lambda expression which returns generators, and followed by space separating -4.
Note: lambda expression is a functional expression.
Hope it helps..
+ 1
, means both are different expressions for print() function
that's why it's printing the object of the function and -4 as integer