Learn Python - Lambdas and Higher order Functions | Map, Filter, Zip and Reduce

preview_player
Показать описание
This video talks about *FUNCTIONAL PROGRAMMING* in Python. It show how you can define lambda functions and also shows uses of higher order functions like map, filter, zip and reduce.

This video starts with a very simple numbers list and shows how we can write lambda expresssion in Python. Then, we move on to implement functions for creating squares list for numbers list and filter operations.

We make use of built-in higher order functions map to transform our list from list of numbers of list of squares. Then, I show the demo of filter function to filter out elements that are even. Zip function is useful for combining elements from two different lists into a single list.

Finally, we make use of reduce function to find the sum of all elements of numbers list. For this, we import reduce function from functools module in Python. Reduce functions makes use of accumulator for collecting sum of all elements.

If you like our content, click on *SUBSCRIBE* button and click on Bell icon to receive latest and greatest updates of my video lessons.

Follow us on Facebook, Twitter, Instagram

Рекомендации по теме