lambda
lambda
lambda functions are nameless function. lambda functions are usually one line functions. lambda functions are usually used as input parameter to map and filter function.
For example:
Make every element of list [1,2,3,4,5] square
Output:
[1, 4, 9, 16, 25]
Filter out odd element, only keep even element of a list
It output below:
[2,4]
Last updated