Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    Advanced Python Features(Lambda, Map, Filter)

    Python is a simple, easy to use yet powerful language. Python includes an infinite number of built-in functions. Here we will discuss some of the beautiful things of the python.

    Lambda: Lambda is an anonymous function. Anonymous functions in python mean that these functions don’t have a name and we write them as one-liners. Normal functions in python start with a def keyword and have a function name. In other words, anonymous does not start with def and does not have any function name. Lambda is one such type of function. Lambda function has one expression and can take any type of argument.

    lambda arguments: expression


    Map: Map is a Python built-in function that is used to iterate an iterable through a specified function. It executes the function through each item in the iterable. It is used to apply a function to a sequence of elements like a list or dictionary.

    map(fun, iterable)


    Filter: Filter is similar to the map but it only returns those values for which the applied function returns True. The function returns an iterator where the items are filtered through a function to test if the item is accepted or not.

    filter(function, iterable)


    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again