Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Lamda
- More like an annonymous function
- `even_num = lambda x: x%2 == 0`
- ## Map
- Takes a functions/lambda and an iterable, and returns a map object. So convert to list
- `square = map(lambda x: x*2, [1,2,3,4,5,6])` #[2, 4, 6, 8, 10, 12]
- ## Filters
- Returns an object that holds true to the condition. Takes a functions/lambda and an iterable just like a Map
- `even = filter(lambda x: x%2 == 0, [1,2,3,4,5,6])` #[2, 4, 6]
Add Comment
Please, Sign In to add comment