Lambda Functions

Lambda functions are small and anonymous functions. Lambda function can take ‘n‘ number of arguments, but will have only one expression. To create a Lambda function in Python, we need use Lambda keyword. Let’s see with an example. If we assign a function to a variable, it becomes an anonymous function and thus a lambdaContinue reading “Lambda Functions”

Functions Again

ArgumentsConsider our previous function that was created that takes two parameters, num1 and num2. So, while calling the function we need to pass the same number of parameters i.e., if the function definition has two parameters, we need to pass two values, if the function definition has three parameters, we need to pass three values.Continue reading “Functions Again”

Functions

Functions are logical grouping of code statements that collectively performs a specific operation or a specific requirement. Example: If I am building a calculator, a calculator can perform various mathematical operations like addition, subtraction, division, etc. I can create one function for addition, one function for subtraction, one function for division, and so on. Let’sContinue reading “Functions”

Design a site like this with WordPress.com
Get started