Lambda: Lambda functions are known as the anonymous functions in Python. This kind of functions are declared without any name.
- Can accept any number of argument.
- Restricted to only a single expression.
- Used only one-time.
- Lambda function is used when you need a function for a short period of time.
Basic syntax:
lambda arguments : expression
Example:
Map: Map is a built-in function that takes a function object and iterable list (list/dictionary) as its parameter.
Basic syntax:
map (function_object, iterable_1, iterable_2, ... )
Few examples of Map in python:
Filter: It works similar way like map. The difference is it makes a new list from the element in the list that satisfy some condition. In case of of parameters, it takes a function and one iterable.
Basic syntax:
filter (function, iterable)
Normally used with lambda functions. Example is given below:
Basic syntax:
map (function_object, iterable_1, iterable_2, ... )
Few examples of Map in python:
Filter: It works similar way like map. The difference is it makes a new list from the element in the list that satisfy some condition. In case of of parameters, it takes a function and one iterable.
Basic syntax:
filter (function, iterable)
Normally used with lambda functions. Example is given below:
Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.I gained many unknown information, the way you have clearly explained is really fantastic.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course
Full Stack Training in Bangalore | Certification | Online Training Course
Full Stack Training in Hyderabad | Certification | Online Training Course
Full Stack Developer Training in Chennai | Mean Stack Developer Training in Chennai
Full Stack Training
Full Stack Online Training
Nice article.keep up with your good work.
ReplyDeletePython classes in Pune