+ 1
Confused about print function with lambda
So syntax is like this print((lambda x: x+2) (4)) How print functions "knows" that 4 should be used in lambda instead of x?
1 ответ
+ 2
because (lambda x: x+2)(4) is interpreted as a single argument. lambda is one of those few functions that require an argument outside of its parenthesis. I do agree that something like (lambda x(4): x+2) would've have been an easier way to synthax it