ANONYMOUS FUNCTIONS (LAMBDA) - PYTHON PROGRAMMING

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends welcome back to our channel so in the previous sessions we have seen the functions concept and then we have seen the difference between the local variable and a global variable and then we have seen the types of arguments and then we have covered the recursion concept so in this session let us have a look on small concept that is anonymous functions so these anonymous functions are also called as land bar functions these functions are also wireless lambda functions so because why these functions are called as an diverse functions because these functions do not define by DVF keyword this function is not defined by DF keyword and these functions will return expression but not when and these functions are one-line functions these functions can take any number of coordinates any number of particles right these functions cannot access global and these functions will be defined by using Ananda keyword so here in Python programming so there is a keyword called lambda so once go through the keywords concept so that you will be so these function this and or how the functions will be declared by using this lambda keyword and these functions will return expression but not a value right so these functions can take any number of Ultimates it can access the global variable saying these are Bob online functions see let us see an example so that you will be clarified so it's a very small concept right here so we can assign this lambda function to one variable and these functions doesn't have anything so actually the user different functions will be having one name right so here these lambda functions or anonymous functions will not having anything but this lambda function can be assigned to some variable so if you want to add two numbers so we can write it as sum is equal to lambda X comma Y colon X plus y so this can be returned initialize it to some and the syntax for this one is user lambda followed by arguments : expression this one is the syntax lambda arguments : expression these ornaments are returned by using separated by comma so similarly sum is equal to lambda X comma Y X plus y so we can simply write print sum is equal to sum of 2 comma 3 this will automatically give the result as 5 right so here X way of the arguments and here X plus y is the expression so that's why we call it as a one-line function and we can have any number of arguments with lambda and only those are tools can be used and it will return expression but not a value so if you are always idle an expression it does not return any value so based upon the expression the inputs will be applied and do not define by using D because here we are using the lambda and this cannot be accessed with the global variables so global variables cannot be used in this lambda function right and function doesn't have any name so this function does not have any name but this function can be assigned to a particular variable so wonderful once again I am writing this index here so C takes but this one is lambda keyword arguments : expression and these arguments can be separated by comma any number of arguments we can give any number of arguments right so hope you understood this simple concept that is anonymous functions or the lambda functions right so hope you understood this one if you are having any doubts regarding this Python programming feel free to post your doubts in the comment section so that I will definitely try to clarify out your doubts so if you really understood my sessions like my videos share my videos with your friends and don't forget to subscribe to our channel thanks for watching thank you very much
Info
Channel: Sundeep Saradhi Kanthety
Views: 27,962
Rating: 4.943728 out of 5
Keywords: SUNDEEP, SARADHI, KANTHETY, PYTHON, PROGRAMMING, HIGH-LEVEL, LANGUAGE, PORTABLE, FEATURES, APPLICATIONS, INSTALLATION, INTERPRETER, PYTHON SHELL, PYTHON SCRIPT, INTRODUCTION, BEGINNERS, GUI, GAMING, WEB DESIGNING, PYTHON 3.7.0, PLATFORM INDEPENDENT, CASE SENSITIVE, SIMPLE, ANONYMOUS FUNCTION, USERDEFINED FUNCTION, LAMBDA KEYWORD, EXPRESSION RETURN, ARGUMENTS, FUNCTION CALL, FUNCTION DEFINITION, RETURN, LOCAL VARIABLE, GLOBAL VARIABLE
Id: CYbMaudWGOM
Channel Id: undefined
Length: 7min 2sec (422 seconds)
Published: Sat Oct 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.