Recursion and lambda function in python
Recursion and lambda function in python
Hello Friends, I am Nirav. And in this tutorial I going to show you Recursion and lambda function in Python..
So, Let's get Started
Recursive
We know that a function can call other functions. it is even possible for the function to call it self. These type of construct are termed as recursive function.
EX:- Example for Factorial value using recursive
Advantage of recursive
1.)It's make code clean and elegant
2.)Sequence generation is easier
Disadvantage of recursive
1.)logic behind recursion is hard to follow
2.)It's hard to debug
Lambda
Lambda is a function which define without name
In python normal functions are define using def keyword but lambda function are define using lambda keyword.
Syntax:- lambda argument = expression
Ex:- Example of lambda function for double value
Use of lambda function
we use it when we required a nameless function for a short period of time.
Filter in lambda
Simply filter meaning to filter something...
Ex:- Hear the example for filter even numbers from list
Map in lambda
Ex:- Hear the example of map in lambda
You also visit my you tube video regarding to this Topic
https://youtu.be/BIJkAQ-rZ7s
Comments
Post a Comment