when i run the code i get a memory location as an output
<function at 0x00000200FF8A5E50>
val = (lambda colmns:(colmns.max + colmns.min)/2
print(val)
when i run the code i get a memory location as an output
<function at 0x00000200FF8A5E50>
val = (lambda colmns:(colmns.max + colmns.min)/2
print(val)
A lambda is just an anonymous function object and that's why it prints that way. In fact, as soon as you assign it to a variable... then why have a lambda in the first place? Might as well do
def foo(colmns):
return (colmns.max + colmns.min)/2
And then it wouldn't be too surprising that print(foo)
is <function 0x...>
.